Update content of files

This commit is contained in:
GitHub Action 2024-11-16 13:54:43 +00:00
parent 737e6fafbb
commit 46aac4b082
7 changed files with 240 additions and 255 deletions

View file

@ -137,7 +137,8 @@ Currently the only allowed subscription period is <code>30*24*60*60</code>, i.e.
<p>Users obtaining info about the invitation link using <a href="/method/messages.checkChatInvite">messages.checkChatInvite</a> will obtain a <a href="/constructor/chatInvite">chatInvite</a> constructor with the <code>subscription_pricing</code> and <code>subscription_form_id</code> flags set. </p>
<p>To pay for the subscription, follow the <a href="/api/payments">usual payment flow »</a>, with the following variation: since subscriptions already have a pre-generated form contained in the <code>subscription_form_id</code> returned in <a href="/constructor/chatInvite">chatInvite</a>, the first two steps of the <a href="/api/payments">payment flow »</a> (those used to generate a payment form) must be skipped, starting directly at the <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> call in <a href="/api/payments#3-payment">step 3 »</a>, passing to <code>invoice</code> an <a href="/constructor/inputInvoiceChatInviteSubscription">inputInvoiceChatInviteSubscription</a> with the <code>hash</code> component of the <a href="/api/links#message-links">invite link</a>, and to <code>form_id</code> the <a href="/constructor/chatInvite">chatInvite</a>.<code>subscription_form_id</code>. </p>
<p>Once the payment is successfully completed, the user will be automatically added to the channel, without having to invoke <a href="/method/messages.importChatInvite">messages.importChatInvite</a> to join the private channel. </p>
<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>The end date of the current subscription period will be contained in <a href="/constructor/channel">channel</a>.<code>subscription_until_date</code>. </p>
<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>; alternatively, <a href="/method/messages.importChatInvite">messages.importChatInvite</a> may simply be used) 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 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>

View file

@ -241,13 +241,16 @@
<a href="/method/payments.getStarsGiveawayOptions">payments.getStarsGiveawayOptions</a>#bd1efd3e = <a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/StarsGiveawayOption">StarsGiveawayOption</a>&gt;;<br>
<a href="/method/messages.getPaidReactionPrivacy">messages.getPaidReactionPrivacy</a>#472455aa = <a href="/type/Updates">Updates</a>;<br></code></pre></div>
<h3><a class="anchor" href="#layer-186" id="layer-186" name="layer-186"><i class="anchor-icon"></i></a><a href="/schema?layer=186">Layer 186</a></h3>
<ul>
<li><code>signature_profiles</code> is a valid min field</li>
</ul>
<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, 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>
<li>Added <a href="/method/messages.sendPaidReaction">messages.sendPaidReaction</a> - Sends one or more <a href="/api/reactions#paid-reactions">paid Telegram Star reactions »</a>, transferring <a href="/api/stars">Telegram Stars »</a> to a channel's balance.</li>
<li>Added <a href="/method/messages.togglePaidReactionPrivacy">messages.togglePaidReactionPrivacy</a> - </li>
</ul>
<h5><a class="anchor" href="#changed-methods" id="changed-methods" name="changed-methods"><i class="anchor-icon"></i></a>Changed Methods</h5>
@ -260,11 +263,11 @@
</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/inputInvoiceChatInviteSubscription">inputInvoiceChatInviteSubscription</a> - </li>
<li>Added <a href="/constructor/inputInvoiceChatInviteSubscription">inputInvoiceChatInviteSubscription</a> - Used to pay for a <a href="/api/stars#star-subscriptions">Telegram Star subscription »</a>.</li>
<li>Added <a href="/constructor/starsSubscriptionPricing">starsSubscriptionPricing</a> - Pricing of a <a href="/api/invites#paid-invite-links">Telegram Star subscription »</a>.</li>
<li>Added <a href="/constructor/starsSubscription">starsSubscription</a> - Represents a <a href="/api/invites#paid-invite-links">Telegram Star subscription »</a>.</li>
<li>Added <a href="/constructor/reactionPaid">reactionPaid</a> - </li>
<li>Added <a href="/constructor/messageReactor">messageReactor</a> - </li>
<li>Added <a href="/constructor/messageReactor">messageReactor</a> - Info about a user in the <a href="/api/reactions#paid-reactions">paid Star reactions leaderboard</a> for a message.</li>
<li>Added <a href="/constructor/channelAdminLogEventActionToggleSignatureProfiles">channelAdminLogEventActionToggleSignatureProfiles</a> - </li>
</ul>
<h5><a class="anchor" href="#changed-constructors" id="changed-constructors" name="changed-constructors"><i class="anchor-icon"></i></a>Changed Constructors</h5>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>channel</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Channel/supergroup info When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor). The only exception to the above rule is when the min flag is set, in which case only the following fields must be applied over any locally stored version: - title - megagroup - color - photo - username - usernames - has_geo - noforwards - emoji_status - has_link - slow_mode_enabled - scam - fake - gigagroup - forum - level - restricted - restriction_reason - join_to_send - join_request - is_verified - default_banned_rights See here » for an implementation of the logic to use when updating the local user peer database.">
<meta property="description" content="Channel/supergroup info When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor). The only exception to the above rule is when the min flag is set, in which case only the following fields must be applied over any locally stored version: - title - megagroup - color - photo - username - usernames - has_geo - noforwards - emoji_status - has_link - slow_mode_enabled - scam - fake - gigagroup - forum - level - restricted - restriction_reason - join_to_send - join_request - is_verified - default_banned_rights - signature_profiles See here » for an implementation of the logic to use when updating the local user peer database.">
<meta property="og:title" content="channel">
<meta property="og:image" content="">
<meta property="og:description" content="Channel/supergroup info When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor). The only exception to the above rule is when the min flag is set, in which case only the following fields must be applied over any locally stored version: - title - megagroup - color - photo - username - usernames - has_geo - noforwards - emoji_status - has_link - slow_mode_enabled - scam - fake - gigagroup - forum - level - restricted - restriction_reason - join_to_send - join_request - is_verified - default_banned_rights See here » for an implementation of the logic to use when updating the local user peer database.">
<meta property="og:description" content="Channel/supergroup info When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor). The only exception to the above rule is when the min flag is set, in which case only the following fields must be applied over any locally stored version: - title - megagroup - color - photo - username - usernames - has_geo - noforwards - emoji_status - has_link - slow_mode_enabled - scam - fake - gigagroup - forum - level - restricted - restriction_reason - join_to_send - join_request - is_verified - default_banned_rights - signature_profiles See here » for an implementation of the logic to use when updating the local user peer database.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -68,6 +68,7 @@
<li><code>join_request</code></li>
<li><code>is_verified</code></li>
<li><code>default_banned_rights</code></li>
<li><code>signature_profiles</code></li>
</ul>
<p>See <a href="https://github.com/tdlib/td/blob/a24af0992245f838f2b4b418a0a2d5fa9caa27b5/td/telegram/ChatManager.cpp#L8329">here »</a> for an implementation of the logic to use when updating the <a href="/api/peers">local user peer database</a>.</p>
<p><div class="clearfix">
@ -221,7 +222,7 @@
<tr>
<td><strong>signature_profiles</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.12?<a href="/constructor/true">true</a></td>
<td> </td>
<td>If set, messages sent by admins to this channel will link to the admin's profile (just like with groups).</td>
</tr>
<tr>
<td><strong>id</strong></td>
@ -311,7 +312,7 @@
<tr>
<td><strong>subscription_until_date</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.11?<a href="/type/int">int</a></td>
<td> </td>
<td>Expiration date of the <a href="/api/stars#star-subscription">Telegram Star subscription »</a> the current user has bought to gain access to this channel.</td>
</tr>
</tbody>
</table>
@ -348,7 +349,9 @@
<h4><a class="anchor" href="#emoji-status" id="emoji-status" name="emoji-status"><i class="anchor-icon"></i></a><a href="/api/emoji-status">Emoji status</a></h4>
<p>Telegram allows users to set an emoticon or a custom emoji as status, to show next to their name in chats and profiles.</p>
<h4><a class="anchor" href="#channel-and-supergroup-boosts" id="channel-and-supergroup-boosts" name="channel-and-supergroup-boosts"><i class="anchor-icon"></i></a><a href="/api/boost">Channel and supergroup boosts</a></h4>
<p>Telegram Premium users can grant their favorite channels and supergroups additional features like the ability to post stories by giving them boosts.</p></div>
<p>Telegram Premium users can grant their favorite channels and supergroups additional features like the ability to post stories by giving them boosts.</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>
</div>

View file

@ -4,42 +4,10 @@
<meta charset="utf-8">
<title>messages.sendPaidReaction</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
peer
InputPeer
 
msg_id
int
 
count
int
 
random_id…">
<meta property="description" content="Sends one or more paid Telegram Star reactions », transferring Telegram Stars » to a channel&#39;s balance.">
<meta property="og:title" content="messages.sendPaidReaction">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
peer
InputPeer
 
msg_id
int
 
count
int
 
random_id…">
<meta property="og:description" content="Sends one or more paid Telegram Star reactions », transferring Telegram Stars » to a channel&#39;s balance.">
<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">
@ -74,7 +42,8 @@ random_id…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/messages.sendPaidReaction" >messages.sendPaidReaction</a></li></ul></div>
<h1 id="dev_page_title">messages.sendPaidReaction</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Sends one or more <a href="/api/reactions#paid-reactions">paid Telegram Star reactions »</a>, transferring <a href="/api/stars">Telegram Stars »</a> to a channel's balance.</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 192 <b class="caret"></b></a>
@ -113,33 +82,42 @@ random_id…">
<tr>
<td><strong>peer</strong></td>
<td style="text-align: center;"><a href="/type/InputPeer">InputPeer</a></td>
<td> </td>
<td>The channel</td>
</tr>
<tr>
<td><strong>msg_id</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td> </td>
<td>The message to react to</td>
</tr>
<tr>
<td><strong>count</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td> </td>
<td>The number of <a href="/api/stars">stars</a> to send (each will increment the reaction counter by one).</td>
</tr>
<tr>
<td><strong>random_id</strong></td>
<td style="text-align: center;"><a href="/type/long">long</a></td>
<td> </td>
<td>Unique client message ID required to prevent message resending</td>
</tr>
<tr>
<td><strong>private</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/Bool">Bool</a></td>
<td> </td>
<td>Each post with star reactions has a leaderboard with the top senders, but users can opt out of appearing there if they prefer more privacy. <br>If the user explicitly chose to make their paid reaction(s) private, pass <a href="/constructor/boolTrue">boolTrue</a> to <a href="/method/messages.sendPaidReaction">messages.sendPaidReaction</a>.<code>private</code>. <br>If the user explicitly chose to make their paid reaction(s) private, pass <a href="/constructor/boolTrue">boolFalse</a> to <a href="/method/messages.sendPaidReaction">messages.sendPaidReaction</a>.<code>private</code>. <br>If the user did not make any explicit choice about the privacy of their paid reaction(s) (i.e. when reacting by clicking on an existing star reaction on a message), do not populate the <a href="/method/messages.sendPaidReaction">messages.sendPaidReaction</a>.<code>private</code> flag.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#result" id="result" name="result"><i class="anchor-icon"></i></a>Result</h3>
<p><a href="/type/Updates">Updates</a></p>
<h3><a class="anchor" href="#bots-can-use-this-method" id="bots-can-use-this-method" name="bots-can-use-this-method"><i class="anchor-icon"></i></a>Bots can use this method</h3></div>
<h3><a class="anchor" href="#bots-can-use-this-method" id="bots-can-use-this-method" name="bots-can-use-this-method"><i class="anchor-icon"></i></a>Bots can use this method</h3>
<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 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>
<h4><a class="anchor" href="#booltrue" id="booltrue" name="booltrue"><i class="anchor-icon"></i></a><a href="/constructor/boolTrue">boolTrue</a></h4>
<p>The constructor can be interpreted as a <strong>boolean</strong><code>true</code> value.</p>
<h4><a class="anchor" href="#messagessendpaidreaction" id="messagessendpaidreaction" name="messagessendpaidreaction"><i class="anchor-icon"></i></a><a href="/method/messages.sendPaidReaction">messages.sendPaidReaction</a></h4>
<p>Sends one or more <a href="/api/reactions#paid-reactions">paid Telegram Star reactions »</a>, transferring <a href="/api/stars">Telegram Stars »</a> to a channel's balance.</p>
<h4><a class="anchor" href="#message-reactions" id="message-reactions" name="message-reactions"><i class="anchor-icon"></i></a><a href="/api/reactions">Message reactions</a></h4>
<p>Telegram allows users to react on any message using specific emojis, triggering cute lottie animations.</p></div>
</div>

View file

@ -3710,7 +3710,7 @@ Look for updates of telegram&#39;s terms of service…">
</tr>
<tr>
<td><a href="/method/messages.sendPaidReaction">messages.sendPaidReaction</a></td>
<td> </td>
<td>Sends one or more <a href="/api/reactions#paid-reactions">paid Telegram Star reactions »</a>, transferring <a href="/api/stars">Telegram Stars »</a> to a channel's balance.</td>
</tr>
<tr>
<td><a href="/method/messages.togglePaidReactionPrivacy">messages.togglePaidReactionPrivacy</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 08 EF 08 00 9F A1 38 67
0010 | 14 00 00 00 F1 8E 7E BE F3 C6 F3 84 6F CA 4D 6D
0020 | 5F 17 DC 5D C0 1C 36 7F</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>C46A0E0034733867</code></td>
<td><code>08EF08009FA13867</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>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</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 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
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D0 30 9F 9F A1 38 67
0010 | 50 00 00 00 63 24 16 05 F3 C6 F3 84 6F CA 4D 6D
0020 | 5F 17 DC 5D C0 1C 36 7F BC D0 94 5F A8 89 89 60
0030 | F8 CD 69 F5 8E 1F 39 63 08 27 55 9F D2 CF 8E 36
0040 | 15 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>0130E52E34733867</code></td>
<td><code>01D0309F9FA13867</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>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td><code>BCD0945FA8898960F8CD69F58E1F3963</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>0820FFA883F77C426D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2377804413021209197</td>
<td><code>0827559FD2CF8E3615000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2834347268273747477</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 = 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>
<pre><code>pq = 2834347268273747477</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2834347268273747477 = 1503116977 * 1885646501</code></p>
<pre><code>p = 1503116977
q = 1885646501</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 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
<pre><code>0000 | 95 5F F5 A9 08 27 55 9F D2 CF 8E 36 15 00 00 00
0010 | 04 59 97 BE B1 00 00 00 04 70 64 AE A5 00 00 00
0020 | F3 C6 F3 84 6F CA 4D 6D 5F 17 DC 5D C0 1C 36 7F
0030 | BC D0 94 5F A8 89 89 60 F8 CD 69 F5 8E 1F 39 63
0040 | 61 FF 7B EC 20 C4 17 99 68 13 23 5C EB E6 96 7B
0050 | 22 6D E6 00 C2 92 C2 63 29 C4 F3 C4 BD 52 92 CE
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 = 1645199299</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>0820FFA883F77C426D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2377804413021209197</td>
<td><code>0827559FD2CF8E3615000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2834347268273747477</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>045625820F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1445298703</td>
<td><code>045997BEB1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1503116977</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>04620FBFC3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1645199299</td>
<td><code>047064AEA5000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1885646501</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>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td><code>BCD0945FA8898960F8CD69F58E1F3963</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>154BB5D014B0F2745F04741BB57D9F8B</code> <code>D7B1F976C847DE78BB2A2D8B8430FF4C</code></td>
<td><code>61FF7BEC20C417996813235CEBE6967B</code> <code>226DE600C292C26329C4F3C4BD5292CE</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1645199299</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 = 955FF5A90820FFA883F77C426D000000045625820F00000004620FBFC3000000DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D38154BB5D014B0F2745F04741BB57D9F8BD7B1F976C847DE78BB2A2D8B8430FF4C02000000
random_padding_bytes = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A72D79F66F029CF1C17532F29741C7FB5836471919A8B0F29539DC40CD4D5C8DE31CC1B2DEDEFEFF07BCCB459DDCF9898914107E72B5597048B61BBED0A18819</code></pre>
<pre><code>data = 955FF5A90827559FD2CF8E3615000000045997BEB1000000047064AEA5000000F3C6F3846FCA4D6D5F17DC5DC01C367FBCD0945FA8898960F8CD69F58E1F396361FF7BEC20C417996813235CEBE6967B226DE600C292C26329C4F3C4BD5292CE02000000
random_padding_bytes = C250C7B9D3DF49688EE29B01C3B65B28399519D05011B6B5D02D9FBD01196222B40B1A2C2E4F594A36149A2E3E13F52F29CE2258CF974A09D3CD69CF128A4588CA8C12A5ED1389CBB519ECF2DD7F351C5CC4D865428C5416E7F96AF3</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 = D194799E424FF5B0B22D56A6832B1FBB1766C9DEE939C714EEBD67F80EBB2C3F2DC4FCF45B9385DE07CBA6D83003C1305C7AFFBF22F0F86D94F47E9EE988048B0483409E15B7FB70860D4EDA946CCE5C325E67162BA79902A8F65AD3F497F2B94E5E7358D3ADB901EED594E59976A8CCE988C623A6734FAB2A04CA698C1A940483252F07593798546E0AA9E5D9EC4A9704729E0CDE060276398E7EA42B430ED9D6ACD6E3E2920E641978F88E4401F504D6461D2D98B1913B572657DDCA9BC9CE99273301E9D1FE403254D9669F8D361492CE1BF0B8E36E51467222F2A4D1788CDBDE1BAEBC1442A561A6046C8D7E223786DFA3A6EC05104B18650B4BD72E43AB</code></pre>
<pre><code>encrypted_data = 1413B01C2BDE24F106079EF6237383E7BFBE8354664CB7F8832D9EFDE180C882334181021885B5C9612012BCFD851F5E197678A4B0EFADB31EEC781421857814D6B677550B12D17DD0DC11D09367F448E90ABD338A25870AD52F3C992F17BFE9BB3A4BA6555585CD2D936896CA3F2AF9C98FF8794ECE5B7506305A5CB6DCDC50C91BAE3CD2520146807C96F9255455E32E8BCFDE340DDE00B69FF98F83C799F241532FBE70F428C2DB502B99B2CFDDC9F9AA65A8E31CF0964A134498E6A8DF15CDB78D588487A388851D178A2CBB9EC836282C6DE4C18C1714DAF616CF24C8C6154ECA93ACF37ABED5281211EC56FEA50061B47FAB1B2546D34D0456917A3D5A</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 84 99 0D 00 9F A1 38 67
0010 | 40 01 00 00 BE E4 12 D7 F3 C6 F3 84 6F CA 4D 6D
0020 | 5F 17 DC 5D C0 1C 36 7F BC D0 94 5F A8 89 89 60
0030 | F8 CD 69 F5 8E 1F 39 63 04 59 97 BE B1 00 00 00
0040 | 04 70 64 AE A5 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 14 13 B0 1C 2B DE 24 F1 06 07 9E F6
0060 | 23 73 83 E7 BF BE 83 54 66 4C B7 F8 83 2D 9E FD
0070 | E1 80 C8 82 33 41 81 02 18 85 B5 C9 61 20 12 BC
0080 | FD 85 1F 5E 19 76 78 A4 B0 EF AD B3 1E EC 78 14
0090 | 21 85 78 14 D6 B6 77 55 0B 12 D1 7D D0 DC 11 D0
00A0 | 93 67 F4 48 E9 0A BD 33 8A 25 87 0A D5 2F 3C 99
00B0 | 2F 17 BF E9 BB 3A 4B A6 55 55 85 CD 2D 93 68 96
00C0 | CA 3F 2A F9 C9 8F F8 79 4E CE 5B 75 06 30 5A 5C
00D0 | B6 DC DC 50 C9 1B AE 3C D2 52 01 46 80 7C 96 F9
00E0 | 25 54 55 E3 2E 8B CF DE 34 0D DE 00 B6 9F F9 8F
00F0 | 83 C7 99 F2 41 53 2F BE 70 F4 28 C2 DB 50 2B 99
0100 | B2 CF DD C9 F9 AA 65 A8 E3 1C F0 96 4A 13 44 98
0110 | E6 A8 DF 15 CD B7 8D 58 84 87 A3 88 85 1D 17 8A
0120 | 2C BB 9E C8 36 28 2C 6D E4 C1 8C 17 14 DA F6 16
0130 | CF 24 C8 C6 15 4E CA 93 AC F3 7A BE D5 28 12 11
0140 | EC 56 FE A5 00 61 B4 7F AB 1B 25 46 D3 4D 04 56
0150 | 91 7A 3D 5A</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 = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>C86A0E0034733867</code></td>
<td><code>84990D009FA13867</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 = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td><code>BCD0945FA8898960F8CD69F58E1F3963</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>045625820F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1445298703</td>
<td><code>045997BEB1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1503116977</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>04620FBFC3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1645199299</td>
<td><code>047064AEA5000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1885646501</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 = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A
<tr>
<td>encrypted_data</td>
<td>80, 260</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><code>FE0001001413B01C2BDE24F106079EF6</code> <code>237383E7BFBE8354664CB7F8832D9EFD</code> <code>E180C882334181021885B5C9612012BC</code> <code>FD851F5E197678A4B0EFADB31EEC7814</code> <code>21857814D6B677550B12D17DD0DC11D0</code> <code>9367F448E90ABD338A25870AD52F3C99</code> <code>2F17BFE9BB3A4BA6555585CD2D936896</code> <code>CA3F2AF9C98FF8794ECE5B7506305A5C</code> <code>B6DCDC50C91BAE3CD2520146807C96F9</code> <code>255455E32E8BCFDE340DDE00B69FF98F</code> <code>83C799F241532FBE70F428C2DB502B99</code> <code>B2CFDDC9F9AA65A8E31CF0964A134498</code> <code>E6A8DF15CDB78D588487A388851D178A</code> <code>2CBB9EC836282C6DE4C18C1714DAF616</code> <code>CF24C8C6154ECA93ACF37ABED5281211</code> <code>EC56FEA50061B47FAB1B2546D34D0456</code><br> <code>917A3D5A</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A
<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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A4 E4 BB 9F A1 38 67
0010 | 78 02 00 00 5C 07 E8 D0 F3 C6 F3 84 6F CA 4D 6D
0020 | 5F 17 DC 5D C0 1C 36 7F BC D0 94 5F A8 89 89 60
0030 | F8 CD 69 F5 8E 1F 39 63 FE 50 02 00 C3 BE EC 89
0040 | 5C D1 EC 5A D6 54 C7 8E 37 2E 8E 60 76 8D CF 65
0050 | C5 13 22 6C C5 57 D4 8A 9A 4A 2B FB 8F E9 63 38
0060 | C1 85 1C 7C CF 14 3A EC F7 FC 86 3F DF 37 83 FA
0070 | E4 41 35 95 58 6E 16 5A C2 B0 CF AC 10 BC 38 3D
0080 | A0 B7 F3 11 D9 1C B0 D9 5A FD 1F 83 C9 A2 48 E1
0090 | CC 81 09 4C 64 D9 6A C9 32 88 7A E5 02 D1 6A 5C
00A0 | 20 8C 54 FA 7F A5 00 9D 49 41 BA F2 07 BB D2 6A
00B0 | D6 AC 08 6B A6 5E 17 44 A6 AE 63 88 AF 8F BB DD
00C0 | D1 34 BF 74 DB 5A E2 B0 A2 57 59 C3 B0 D7 B9 82
00D0 | 15 BF 67 67 EE B2 7F 05 F6 D5 55 E8 EB EB A3 98
00E0 | 68 E8 2C EE 9C 4C 52 BA 5B 81 D9 98 25 4B 5E 00
00F0 | 98 56 1E 1A 08 D7 AC 46 78 B0 77 8F DD 31 CB A0
0100 | CF 34 19 9F 5B C9 41 CC 32 1F 3E 96 47 49 D1 42
0110 | 88 30 50 90 4B 82 A1 5F 23 AC 1E 96 37 B4 8B 96
0120 | A9 02 B7 0D 6B 98 4A 5D 4F 20 E9 A5 88 8D 89 EE
0130 | 07 E3 A4 4D A0 8D 95 E6 00 76 1D 9C EF 41 27 23
0140 | 51 93 6A A4 D7 1E 23 45 49 9E 83 3A 96 DB FD 14
0150 | C3 0A 46 E7 01 F8 78 76 19 E8 AE 1B 44 EA FB 5A
0160 | 89 1A 28 B0 04 C3 E5 34 E6 FC EF 79 C0 EB 62 A5
0170 | 21 18 DE D1 91 BF 70 E3 4A 2B 3A DE CC FA 58 C0
0180 | 32 B1 3E CF 88 CB 42 DE CA 88 8A AA 1F BF A5 AC
0190 | C7 F4 02 9A A6 D6 11 73 CB 0B DE F1 27 76 9D 1C
01A0 | 10 E3 6A 00 41 F0 35 E6 4A D5 C2 81 8F 6E 3C CE
01B0 | 80 5A F2 29 5D 28 B9 D9 78 89 33 04 3C 40 B2 6A
01C0 | 42 86 96 79 F1 E7 E0 D2 BA C0 92 21 5A 74 A0 84
01D0 | E2 5F 4E 8E 8E 06 01 0D 22 18 F2 10 40 E6 D5 97
01E0 | 38 92 B5 9B 07 77 96 E4 E4 FA AB BE 20 DD 27 9A
01F0 | D7 35 69 D5 06 21 87 1B 4C 21 50 A0 01 2A 94 CC
0200 | FE 8F BD 94 51 51 87 F1 46 57 12 81 28 A4 18 D8
0210 | D2 6A 84 29 60 2A 10 C8 12 D4 25 68 A5 48 D4 63
0220 | 9A 89 CD 3C 26 A4 E2 FD 9D 10 A8 5E 6B E9 73 2E
0230 | C3 3A CF EC 25 74 C0 65 82 49 E1 FF F1 A6 0B 30
0240 | 93 10 AF 70 5A 07 03 25 08 61 C9 D3 D3 85 08 22
0250 | 9A 50 D0 0F 98 D5 58 51 67 C7 BC 56 7E 11 63 60
0260 | B8 E5 E1 77 B3 03 77 43 AB 38 FF 3E DD C3 7C 0B
0270 | 8A E5 A4 F9 03 2C 1F 76 14 9F 9A 2C 9E 50 0E A8
0280 | C0 E9 91 64 90 80 75 2A 94 B8 C7 7C</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 = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>013CD25034733867</code></td>
<td><code>01A4E4BB9FA13867</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 = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td><code>BCD0945FA8898960F8CD69F58E1F3963</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</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><code>FE500200C3BEEC895CD1EC5AD654C78E</code> <code>372E8E60768DCF65C513226CC557D48A</code> <code>9A4A2BFB8FE96338C1851C7CCF143AEC</code> <code>F7FC863FDF3783FAE4413595586E165A</code> <code>C2B0CFAC10BC383DA0B7F311D91CB0D9</code> <code>5AFD1F83C9A248E1CC81094C64D96AC9</code> <code>32887AE502D16A5C208C54FA7FA5009D</code> <code>4941BAF207BBD26AD6AC086BA65E1744</code> <code>A6AE6388AF8FBBDDD134BF74DB5AE2B0</code> <code>A25759C3B0D7B98215BF6767EEB27F05</code> <code>F6D555E8EBEBA39868E82CEE9C4C52BA</code> <code>5B81D998254B5E0098561E1A08D7AC46</code> <code>78B0778FDD31CBA0CF34199F5BC941CC</code> <code>321F3E964749D142883050904B82A15F</code> <code>23AC1E9637B48B96A902B70D6B984A5D</code> <code>4F20E9A5888D89EE07E3A44DA08D95E6</code> <code>00761D9CEF41272351936AA4D71E2345</code> <code>499E833A96DBFD14C30A46E701F87876</code> <code>19E8AE1B44EAFB5A891A28B004C3E534</code> <code>E6FCEF79C0EB62A52118DED191BF70E3</code> <code>4A2B3ADECCFA58C032B13ECF88CB42DE</code> <code>CA888AAA1FBFA5ACC7F4029AA6D61173</code> <code>CB0BDEF127769D1C10E36A0041F035E6</code> <code>4AD5C2818F6E3CCE805AF2295D28B9D9</code> <code>788933043C40B26A42869679F1E7E0D2</code> <code>BAC092215A74A084E25F4E8E8E06010D</code> <code>2218F21040E6D5973892B59B077796E4</code> <code>E4FAABBE20DD279AD73569D50621871B</code> <code>4C2150A0012A94CCFE8FBD94515187F1</code> <code>4657128128A418D8D26A8429602A10C8</code> <code>12D42568A548D4639A89CD3C26A4E2FD</code> <code>9D10A85E6BE9732EC33ACFEC2574C065</code> <code>8249E1FFF1A60B309310AF705A070325</code> <code>0861C9D3D38508229A50D00F98D55851</code> <code>67C7BC567E116360B8E5E177B3037743</code> <code>AB38FF3EDDC37C0B8AE5A4F9032C1F76</code> <code>149F9A2C9E500EA8C0E991649080752A</code><br> <code>94B8C77C</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A
<!-- 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 = 174A12EC3C20578501341F4ECFCA985F17E74190E503752D6834CBE2F128452CE41CAB839B6A270EC8571A19D95D23579E16596B20D735471BEF728E94676F757FE36AFED425993093580B36742822EFDA7656C95A94B3A87A4244400481494E8FA36B5D52B6B5C8D6D3270F3F7D2CAB08475CFCBFF88B9349FC7DA799EE5A8C5373F2178C262729D93D691A8E184591386101154B298ECC023AC7DCCCCF470A6AC6BF099502FED0A20BD571EEC639B277B6FA1F0B18B712A7C49AAE2BC5EA67DD4E11C394A86BF37E6718E7C232F4180CA2302534758A4E14B435685F2A36750D1C9AD5DDAA0DA8472777869714685D74D52D139DF91867C4954B3B11F1DAE640DA2FB86EC241909CCFBF1648C27156D92B69CF1906E1E1AB0C36A4DB7386FF9AA340F6B5D354412A985A54F91741D5EF913D2458971676C819E2DB3918948E70445EBE19B4A5FD7567CE04292A4BF4651DB880D9E2BC10C49714812FAACE73E7283CC3DE9DA67533C07833509504FD1E1A349B22612B7D938A78E200D525F3BDB60E30A4150CE92D8D5889FBD2F22CCC9046C62A4CA27CFE741B559F6874B6C2CC5C3FF274A8674A23E0F2B8A670D80F9C22E40C16DD99E3754B23C6D35DD462099851C42BA067C75FE16813BC9D933AE879E2ADE232CC581F3850925359CE6633A462B7258560E3B135CA8E5AC5ED56F4F196E7BB0280E247CBD79557E44330D0F45DF282C067A82DB9419426BC549BF5B468F70EE9C81E183C004F7D1BF1F3E2BBD8854F78B801929C7ED869BB8A420104CBC4E964697E9ADA4B55BC9E8FF9C2C0D75F1A2F4EFD5416933D6DB746
tmp_aes_key = C3CC8BD927F95C57F5565994829974576F927A242E37E9166F8E1464A9E290DA
tmp_aes_iv = 4607FCB9E6397C9A9F6C179F561B660532DFF53B6782FE4E563FD12A154BB5D0</code></pre>
<pre><code>encrypted_answer = C3BEEC895CD1EC5AD654C78E372E8E60768DCF65C513226CC557D48A9A4A2BFB8FE96338C1851C7CCF143AECF7FC863FDF3783FAE4413595586E165AC2B0CFAC10BC383DA0B7F311D91CB0D95AFD1F83C9A248E1CC81094C64D96AC932887AE502D16A5C208C54FA7FA5009D4941BAF207BBD26AD6AC086BA65E1744A6AE6388AF8FBBDDD134BF74DB5AE2B0A25759C3B0D7B98215BF6767EEB27F05F6D555E8EBEBA39868E82CEE9C4C52BA5B81D998254B5E0098561E1A08D7AC4678B0778FDD31CBA0CF34199F5BC941CC321F3E964749D142883050904B82A15F23AC1E9637B48B96A902B70D6B984A5D4F20E9A5888D89EE07E3A44DA08D95E600761D9CEF41272351936AA4D71E2345499E833A96DBFD14C30A46E701F8787619E8AE1B44EAFB5A891A28B004C3E534E6FCEF79C0EB62A52118DED191BF70E34A2B3ADECCFA58C032B13ECF88CB42DECA888AAA1FBFA5ACC7F4029AA6D61173CB0BDEF127769D1C10E36A0041F035E64AD5C2818F6E3CCE805AF2295D28B9D9788933043C40B26A42869679F1E7E0D2BAC092215A74A084E25F4E8E8E06010D2218F21040E6D5973892B59B077796E4E4FAABBE20DD279AD73569D50621871B4C2150A0012A94CCFE8FBD94515187F14657128128A418D8D26A8429602A10C812D42568A548D4639A89CD3C26A4E2FD9D10A85E6BE9732EC33ACFEC2574C0658249E1FFF1A60B309310AF705A0703250861C9D3D38508229A50D00F98D5585167C7BC567E116360B8E5E177B3037743AB38FF3EDDC37C0B8AE5A4F9032C1F76149F9A2C9E500EA8C0E991649080752A94B8C77C
tmp_aes_key = 14444D2E97F2965361A855080116B5B7660CC9B01833A9E65FE174A5D3998EFA
tmp_aes_iv = 1000B78D04D1218EE73281AAACC5043BBF035441C9F231928F9946CD61FF7BEC</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 1D76F54DB420019B5241F52A1B1BA1C36E1AE881BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010002E5CA08F1D3BA7137A49ED7EC7F6CB589385C5A8E90F83235B56848E31E5D4967D11D1C2F6A208086FA30017D3F218938A6640A541485ADE693C1533DE9022B4D5AEC13600BDED49CAD9E425047D50842D6AAE97360EBDB20B1C9C04FB212B48B51D44E248EB458C2EFCE4931F9FD68AE4BC85C9FF85F5F12B463191225D851F454F660436FFC5C002FA4175F585C737AADE8C770BC4CB25E942D447326913D2AA41E8AF7182CB8C21F7FC40D6B08F6BFE3D3BB1C058C1E206FAF305E1496C5762FD24E67416F3775C38F1B86BE811E589BE93C6E27AA1075E2F244BD0D1656CE0AB6EAEE8A138BC8668262644A929F8A170A3E8F9E51437760C026EAAFE9063473386722E0578FB4FFEACA
answer = BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010002E5CA08F1D3BA7137A49ED7EC7F6CB589385C5A8E90F83235B56848E31E5D4967D11D1C2F6A208086FA30017D3F218938A6640A541485ADE693C1533DE9022B4D5AEC13600BDED49CAD9E425047D50842D6AAE97360EBDB20B1C9C04FB212B48B51D44E248EB458C2EFCE4931F9FD68AE4BC85C9FF85F5F12B463191225D851F454F660436FFC5C002FA4175F585C737AADE8C770BC4CB25E942D447326913D2AA41E8AF7182CB8C21F7FC40D6B08F6BFE3D3BB1C058C1E206FAF305E1496C5762FD24E67416F3775C38F1B86BE811E589BE93C6E27AA1075E2F244BD0D1656CE0AB6EAEE8A138BC8668262644A929F8A170A3E8F9E51437760C026EAAFE9063473386722E0578FB4FFEACA</code></pre>
<pre><code>answer_with_hash = C78918986B2D95349961BB0CA1C64A0D4B87493DBA0D89B5F3C6F3846FCA4D6D5F17DC5DC01C367FBCD0945FA8898960F8CD69F58E1F396303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010064309197ED7E87B825C2A9C5262DD94853F8D3949835A76C6927714E0550929DBA2A8C8CA3013F3626ADEA35D6748C37B49BA1F5A742D656C8BE77293C639C2AD1FE717FC38AAE70D865D51AEEB7C20E1B0751D2FABABA321798C858FCD8E3B36D20959DB6AB20C5FE09E71F4A03EC54B7626BBEF6B3335391F0943F71D32EA39F00194069B160C71245A1D3818D8F1A7855CBE5D701D8FBB9E0DD76FBFF556A076ED396494D93233576FE11889C4428FD12399B1B51A852138306CAAC69F7EF92DE4E36B4FBA5063A649189857358CDB86CAFBFCE39CFB3BAA29191CFCADAADFDC55D4C12375083AAF959695CB6490D1E6CF9BE3BA96C21EED606B63D8A6DEF9FA13867E9B292340D783705
answer = BA0D89B5F3C6F3846FCA4D6D5F17DC5DC01C367FBCD0945FA8898960F8CD69F58E1F396303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010064309197ED7E87B825C2A9C5262DD94853F8D3949835A76C6927714E0550929DBA2A8C8CA3013F3626ADEA35D6748C37B49BA1F5A742D656C8BE77293C639C2AD1FE717FC38AAE70D865D51AEEB7C20E1B0751D2FABABA321798C858FCD8E3B36D20959DB6AB20C5FE09E71F4A03EC54B7626BBEF6B3335391F0943F71D32EA39F00194069B160C71245A1D3818D8F1A7855CBE5D701D8FBB9E0DD76FBFF556A076ED396494D93233576FE11889C4428FD12399B1B51A852138306CAAC69F7EF92DE4E36B4FBA5063A649189857358CDB86CAFBFCE39CFB3BAA29191CFCADAADFDC55D4C12375083AAF959695CB6490D1E6CF9BE3BA96C21EED606B63D8A6DEF9FA13867E9B292340D783705</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 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
<pre><code>0000 | BA 0D 89 B5 F3 C6 F3 84 6F CA 4D 6D 5F 17 DC 5D
0010 | C0 1C 36 7F BC D0 94 5F A8 89 89 60 F8 CD 69 F5
0020 | 8E 1F 39 63 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 = BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3
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 | 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>
0130 | 64 30 91 97 ED 7E 87 B8 25 C2 A9 C5 26 2D D9 48
0140 | 53 F8 D3 94 98 35 A7 6C 69 27 71 4E 05 50 92 9D
0150 | BA 2A 8C 8C A3 01 3F 36 26 AD EA 35 D6 74 8C 37
0160 | B4 9B A1 F5 A7 42 D6 56 C8 BE 77 29 3C 63 9C 2A
0170 | D1 FE 71 7F C3 8A AE 70 D8 65 D5 1A EE B7 C2 0E
0180 | 1B 07 51 D2 FA BA BA 32 17 98 C8 58 FC D8 E3 B3
0190 | 6D 20 95 9D B6 AB 20 C5 FE 09 E7 1F 4A 03 EC 54
01A0 | B7 62 6B BE F6 B3 33 53 91 F0 94 3F 71 D3 2E A3
01B0 | 9F 00 19 40 69 B1 60 C7 12 45 A1 D3 81 8D 8F 1A
01C0 | 78 55 CB E5 D7 01 D8 FB B9 E0 DD 76 FB FF 55 6A
01D0 | 07 6E D3 96 49 4D 93 23 35 76 FE 11 88 9C 44 28
01E0 | FD 12 39 9B 1B 51 A8 52 13 83 06 CA AC 69 F7 EF
01F0 | 92 DE 4E 36 B4 FB A5 06 3A 64 91 89 85 73 58 CD
0200 | B8 6C AF BF CE 39 CF B3 BA A2 91 91 CF CA DA AD
0210 | FD C5 5D 4C 12 37 50 83 AA F9 59 69 5C B6 49 0D
0220 | 1E 6C F9 BE 3B A9 6C 21 EE D6 06 B6 3D 8A 6D EF
0230 | 9F A1 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 = BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td><code>BCD0945FA8898960F8CD69F58E1F3963</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3
<tr>
<td>g_a</td>
<td>300, 260</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>FE00010064309197ED7E87B825C2A9C5</code> <code>262DD94853F8D3949835A76C6927714E</code> <code>0550929DBA2A8C8CA3013F3626ADEA35</code> <code>D6748C37B49BA1F5A742D656C8BE7729</code> <code>3C639C2AD1FE717FC38AAE70D865D51A</code> <code>EEB7C20E1B0751D2FABABA321798C858</code> <code>FCD8E3B36D20959DB6AB20C5FE09E71F</code> <code>4A03EC54B7626BBEF6B3335391F0943F</code> <code>71D32EA39F00194069B160C71245A1D3</code> <code>818D8F1A7855CBE5D701D8FBB9E0DD76</code> <code>FBFF556A076ED396494D93233576FE11</code> <code>889C4428FD12399B1B51A852138306CA</code> <code>AC69F7EF92DE4E36B4FBA5063A649189</code> <code>857358CDB86CAFBFCE39CFB3BAA29191</code> <code>CFCADAADFDC55D4C12375083AAF95969</code> <code>5CB6490D1E6CF9BE3BA96C21EED606B6</code><br> <code>3D8A6DEF</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>34733867</code> (1731752756 in decimal)</td>
<td><code>9FA13867</code> (1731764639 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3
<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 = 8F1F0600EA228E24D523E70EF1BD9EAE4878EB9F93A7C1D6F4B58ECE228DB51B79DC14D1117C139BE25D994E8584245ED2E137E322EE6450EBD1AF9B6DC5FB44DE964F41FE8163D51C37E2B05FA3E8C35ECFB5E0427F89A5E52BBD7829CC5E20754C0BB70995D4C461F343D66D40CEA859352054BE6017296A61EF89D1AF02D90ECE13D321BF52E5F5371D6C27E79FDD1274836C63D9A7ACD6A2E56949879A0BEB3D13A0A558EB9AC61ECAB15BB31BF499EB1BB55581598653790FE157326B6184D71360861AE92E592EC3CB2AD6F3DB2E6D00F8EE680BDAD0B65A11889F09DEA9221DC602EDBB40A18ABCCCFA45A98366A5B30CA5AEE2A706297ECE8B5D2E32</code></pre>
<pre><code>b = 24D6948F069F0692642B2BB1EEE84FAC2DFA2592BA07CBE9043CCD52D46671437DA9E2554F0EB04649B141E8C492133608BC0AB97CE39FC51C35A48D9A0FE08496786BAFC68388218FBB50F71B1224C0D92487EB10B7270D7119FFBCBEE9356B3B7E908EC05723F25791FB167A97E59EDEE611554806337395D58021E2A1A34B5E387B4084357BF2BDCC878E94AEFCC31E4BF2B9A4A0AF79EAA939F085119FDF3170538FE6B5C8C86BD68B829390AC421E8229F280D5CE66537981A5E2DAC46C6B0BD1148949D928FE0D04FAD968ECD29B41BCB4E8048BF3B125F4BE5BDEB2F6E10BE19747DA312F8029BEED224308095B02981B15DA4DF80A45411B4502D435</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 = 1A5A1D23F7AA2DD9DEC1D446C76D609A55B36BDFF7BC6306258D00755DF586997D56491AA5A5D6B77DE6BF7FF733C8F8CC255ED31A13FDCA5AE71CC555255B9C767BCE8ACC5C9D729B5BC8C4F9EDA78C57C576B2018CD0E69118CC1F436F18A64A2C17DE8D0F4D5D15DF491CA0C9F660A3CE03655693269B20F95C25585744B7EC7BD50702810A6CCFB9E2B57738873DE628B1D212409A24D5C33D2BE9CC07E409A74CDFC772C5B964B18AC37F7F5B0E4CB4846C0A743522AA5ABDCA318F96007A79FA04276EFC807B445F4C62A9C3B913F7837ADBBA8072532984F768F0CE42689E1AFA318A9AB882D44750DE09F310034EE7A6A070C70E6AC09B999951311E</code></pre>
<pre><code>g_b = 6B8B554F20E59FD2C0F6ECD9038941330F790CA16ECDC221F38AA4E1336A93515E93E42BF2E74F71ECC2BE4BBE3D55757735474D2FC67B334219E0CF20B39CE1035DFC06932FFBA36E2F701FED5C4439700F8B0370DAAE259A4CFB16D39ECCF55EE28DCCB59279064EB69772AAD2EB1F6413A5127E503ABF8A586F07181298551ACC29F91CA011DABA9192188F21A5AE130C31E6E7C47F87052C87AE4598E479AFEAE4234278317AEC386AC8F5C345C15863AB35824560A396202F13477E7320974AB22C176BABC8E7864810F255C7BFFA723AC751CBAE408C7DE15EBFDF7CA4B181CC2EE01313E49FD65AF53935049BE7B4F75404DC243B5C218A37A65D3077</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 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>
<pre><code>0000 | 54 B6 43 66 F3 C6 F3 84 6F CA 4D 6D 5F 17 DC 5D
0010 | C0 1C 36 7F BC D0 94 5F A8 89 89 60 F8 CD 69 F5
0020 | 8E 1F 39 63 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 6B 8B 55 4F 20 E5 9F D2 C0 F6 EC D9 03 89 41 33
0040 | 0F 79 0C A1 6E CD C2 21 F3 8A A4 E1 33 6A 93 51
0050 | 5E 93 E4 2B F2 E7 4F 71 EC C2 BE 4B BE 3D 55 75
0060 | 77 35 47 4D 2F C6 7B 33 42 19 E0 CF 20 B3 9C E1
0070 | 03 5D FC 06 93 2F FB A3 6E 2F 70 1F ED 5C 44 39
0080 | 70 0F 8B 03 70 DA AE 25 9A 4C FB 16 D3 9E CC F5
0090 | 5E E2 8D CC B5 92 79 06 4E B6 97 72 AA D2 EB 1F
00A0 | 64 13 A5 12 7E 50 3A BF 8A 58 6F 07 18 12 98 55
00B0 | 1A CC 29 F9 1C A0 11 DA BA 91 92 18 8F 21 A5 AE
00C0 | 13 0C 31 E6 E7 C4 7F 87 05 2C 87 AE 45 98 E4 79
00D0 | AF EA E4 23 42 78 31 7A EC 38 6A C8 F5 C3 45 C1
00E0 | 58 63 AB 35 82 45 60 A3 96 20 2F 13 47 7E 73 20
00F0 | 97 4A B2 2C 17 6B AB C8 E7 86 48 10 F2 55 C7 BF
0100 | FA 72 3A C7 51 CB AE 40 8C 7D E1 5E BF DF 7C A4
0110 | B1 81 CC 2E E0 13 13 E4 9F D6 5A F5 39 35 04 9B
0120 | E7 B4 F7 54 04 DC 24 3B 5C 21 8A 37 A6 5D 30 77</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 = BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td><code>BCD0945FA8898960F8CD69F58E1F3963</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</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><code>FE0001006B8B554F20E59FD2C0F6ECD9</code> <code>038941330F790CA16ECDC221F38AA4E1</code> <code>336A93515E93E42BF2E74F71ECC2BE4B</code> <code>BE3D55757735474D2FC67B334219E0CF</code> <code>20B39CE1035DFC06932FFBA36E2F701F</code> <code>ED5C4439700F8B0370DAAE259A4CFB16</code> <code>D39ECCF55EE28DCCB59279064EB69772</code> <code>AAD2EB1F6413A5127E503ABF8A586F07</code> <code>181298551ACC29F91CA011DABA919218</code> <code>8F21A5AE130C31E6E7C47F87052C87AE</code> <code>4598E479AFEAE4234278317AEC386AC8</code> <code>F5C345C15863AB35824560A396202F13</code> <code>477E7320974AB22C176BABC8E7864810</code> <code>F255C7BFFA723AC751CBAE408C7DE15E</code> <code>BFDF7CA4B181CC2EE01313E49FD65AF5</code> <code>3935049BE7B4F75404DC243B5C218A37</code><br> <code>A65D3077</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 = BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3
<!-- 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 = 54B64366DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D380000000000000000FE0001001A5A1D23F7AA2DD9DEC1D446C76D609A55B36BDFF7BC6306258D00755DF586997D56491AA5A5D6B77DE6BF7FF733C8F8CC255ED31A13FDCA5AE71CC555255B9C767BCE8ACC5C9D729B5BC8C4F9EDA78C57C576B2018CD0E69118CC1F436F18A64A2C17DE8D0F4D5D15DF491CA0C9F660A3CE03655693269B20F95C25585744B7EC7BD50702810A6CCFB9E2B57738873DE628B1D212409A24D5C33D2BE9CC07E409A74CDFC772C5B964B18AC37F7F5B0E4CB4846C0A743522AA5ABDCA318F96007A79FA04276EFC807B445F4C62A9C3B913F7837ADBBA8072532984F768F0CE42689E1AFA318A9AB882D44750DE09F310034EE7A6A070C70E6AC09B999951311E
padding = 6226EC63E93464D393BEE8B0
tmp_aes_key = C3CC8BD927F95C57F5565994829974576F927A242E37E9166F8E1464A9E290DA
tmp_aes_iv = 4607FCB9E6397C9A9F6C179F561B660532DFF53B6782FE4E563FD12A154BB5D0</code></pre>
<pre><code>data = 54B64366F3C6F3846FCA4D6D5F17DC5DC01C367FBCD0945FA8898960F8CD69F58E1F39630000000000000000FE0001006B8B554F20E59FD2C0F6ECD9038941330F790CA16ECDC221F38AA4E1336A93515E93E42BF2E74F71ECC2BE4BBE3D55757735474D2FC67B334219E0CF20B39CE1035DFC06932FFBA36E2F701FED5C4439700F8B0370DAAE259A4CFB16D39ECCF55EE28DCCB59279064EB69772AAD2EB1F6413A5127E503ABF8A586F07181298551ACC29F91CA011DABA9192188F21A5AE130C31E6E7C47F87052C87AE4598E479AFEAE4234278317AEC386AC8F5C345C15863AB35824560A396202F13477E7320974AB22C176BABC8E7864810F255C7BFFA723AC751CBAE408C7DE15EBFDF7CA4B181CC2EE01313E49FD65AF53935049BE7B4F75404DC243B5C218A37A65D3077
padding = 805A3652D572D8A00CC641A7
tmp_aes_key = 14444D2E97F2965361A855080116B5B7660CC9B01833A9E65FE174A5D3998EFA
tmp_aes_iv = 1000B78D04D1218EE73281AAACC5043BBF035441C9F231928F9946CD61FF7BEC</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 = C5189C9B7C88624E7CE0C220A165A05F9DA8AC40D50ED71CDCE13C990FBAEEE29DA123D967C4AB5B66FBFBB036D3F88FE8C0EF6EA31055D02F5825017EF519ACD1730350AD3CECA1208BCC3808632B0A3D7E8A83EB633E6C91660B2AB057A5EC0E365C31D10F00D98A4C33191DCB4BDF3338F85FF0EEF1663F8FB7624C50A702EDCFA984F66D3931D1CF22AC7D43DA24BF8CCB2768002221380F837EA99029B240A96747569C5AFB89AB8B5EFC158971C5E02AC124357B3E6F66DF2076512D659D7803B3853532E81EF13ECE6EABDF9517E2070DE10CE996965BADCD6B423F2D74FA56D3A1C36342550361331B761B23AB5AC04BD54278E7C8EB6F3E125FA9C1E20692F8DFC4220786FB20E1370F6B95D175894419FAFA51EE516A59F1A59C1C2BA4067C97EBF2FDD41F00EE58859FDA0AE8AF7DA0515DD87F087A15BA419868E7CF947DC07F3D92F55EFCDC3E317F98</code></pre>
<pre><code>encrypted_data = 8D118132E18810CF952B4E43E22ECCAAEC55ED33F3DC451943AE50CF2BFCA79F824B9DFB106B9DEB170286A51981E37B4C7D0DD42F1E737CD50A510ABD667C81C829DBD6F1B8051051C168C481C88B6533E5E55454D065EF3EE7E0DDCCAA841A0835D01C1E5A881C328F5AB8FC7699109947F112C28F35039A21D79E8029140208ABECAB7EA67C20E644231189B0461933710A89B955B0AC8E5F673ECEEF01E67E11408C7B6CD904505B8A94FF46094EA17DB1F854E5BFE709286FCA084EE6F2DD107BB2AEC2B9C9B22FB84894C235E589F99E5600F70BE8DBC5F6D952C8EE0366D5F8CBB34EDF6DBEC9600606137FE19FDAEB648702832E85D23D0FE0EE74B26C180BAA05BEF38884BB2C6DFFD0C5E15CD1A3251D73CF8108A68E202869811CECBBDC19728C800E911FD860541A3E7E4AFB6BF102CE1734316BC5069C76504E58F5C89A587748ED9B26E710361E7685</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 88 99 0D 00 9F A1 38 67
0010 | 78 01 00 00 1F 5F 04 F5 F3 C6 F3 84 6F CA 4D 6D
0020 | 5F 17 DC 5D C0 1C 36 7F BC D0 94 5F A8 89 89 60
0030 | F8 CD 69 F5 8E 1F 39 63 FE 50 01 00 8D 11 81 32
0040 | E1 88 10 CF 95 2B 4E 43 E2 2E CC AA EC 55 ED 33
0050 | F3 DC 45 19 43 AE 50 CF 2B FC A7 9F 82 4B 9D FB
0060 | 10 6B 9D EB 17 02 86 A5 19 81 E3 7B 4C 7D 0D D4
0070 | 2F 1E 73 7C D5 0A 51 0A BD 66 7C 81 C8 29 DB D6
0080 | F1 B8 05 10 51 C1 68 C4 81 C8 8B 65 33 E5 E5 54
0090 | 54 D0 65 EF 3E E7 E0 DD CC AA 84 1A 08 35 D0 1C
00A0 | 1E 5A 88 1C 32 8F 5A B8 FC 76 99 10 99 47 F1 12
00B0 | C2 8F 35 03 9A 21 D7 9E 80 29 14 02 08 AB EC AB
00C0 | 7E A6 7C 20 E6 44 23 11 89 B0 46 19 33 71 0A 89
00D0 | B9 55 B0 AC 8E 5F 67 3E CE EF 01 E6 7E 11 40 8C
00E0 | 7B 6C D9 04 50 5B 8A 94 FF 46 09 4E A1 7D B1 F8
00F0 | 54 E5 BF E7 09 28 6F CA 08 4E E6 F2 DD 10 7B B2
0100 | AE C2 B9 C9 B2 2F B8 48 94 C2 35 E5 89 F9 9E 56
0110 | 00 F7 0B E8 DB C5 F6 D9 52 C8 EE 03 66 D5 F8 CB
0120 | B3 4E DF 6D BE C9 60 06 06 13 7F E1 9F DA EB 64
0130 | 87 02 83 2E 85 D2 3D 0F E0 EE 74 B2 6C 18 0B AA
0140 | 05 BE F3 88 84 BB 2C 6D FF D0 C5 E1 5C D1 A3 25
0150 | 1D 73 CF 81 08 A6 8E 20 28 69 81 1C EC BB DC 19
0160 | 72 8C 80 0E 91 1F D8 60 54 1A 3E 7E 4A FB 6B F1
0170 | 02 CE 17 34 31 6B C5 06 9C 76 50 4E 58 F5 C8 9A
0180 | 58 77 48 ED 9B 26 E7 10 36 1E 76 85</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>CC6A0E0034733867</code></td>
<td><code>88990D009FA13867</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>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td><code>BCD0945FA8898960F8CD69F58E1F3963</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</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><code>FE5001008D118132E18810CF952B4E43</code> <code>E22ECCAAEC55ED33F3DC451943AE50CF</code> <code>2BFCA79F824B9DFB106B9DEB170286A5</code> <code>1981E37B4C7D0DD42F1E737CD50A510A</code> <code>BD667C81C829DBD6F1B8051051C168C4</code> <code>81C88B6533E5E55454D065EF3EE7E0DD</code> <code>CCAA841A0835D01C1E5A881C328F5AB8</code> <code>FC7699109947F112C28F35039A21D79E</code> <code>8029140208ABECAB7EA67C20E6442311</code> <code>89B0461933710A89B955B0AC8E5F673E</code> <code>CEEF01E67E11408C7B6CD904505B8A94</code> <code>FF46094EA17DB1F854E5BFE709286FCA</code> <code>084EE6F2DD107BB2AEC2B9C9B22FB848</code> <code>94C235E589F99E5600F70BE8DBC5F6D9</code> <code>52C8EE0366D5F8CBB34EDF6DBEC96006</code> <code>06137FE19FDAEB648702832E85D23D0F</code> <code>E0EE74B26C180BAA05BEF38884BB2C6D</code> <code>FFD0C5E15CD1A3251D73CF8108A68E20</code> <code>2869811CECBBDC19728C800E911FD860</code> <code>541A3E7E4AFB6BF102CE1734316BC506</code> <code>9C76504E58F5C89A587748ED9B26E710</code><br> <code>361E7685</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 = 72CCEFE497C7AD95D6FAA68228F1D91CB6B7EB9759CF87AB9C55F9177935B3F3943A266C6806AC2553690A4C1C8482D6691254885FBB9EBE200A7AD00FC17378C0D140387830B48BAE1D05B4A0EA2A9A899780E880B83F9D564285633C732D61BDDB41060C8E908643DDCAECC9D2F40025AA8AE78AE84DA39717CC86428906BFFDE1C394654EE80C3FA251858E66E1CBF8D45365AB9933178EB4FFE629F63418A1A6799EB43BBD2851C32124A27FEF6AF07600EEC15EC6B57716F92AA0DD58FF1F03C901BBF94AE73CCF2192A6CCD3D3AC2968D3CD0D7570E31ABE6170B9531BE6F9D40DE277EE0632C6397525456116A076DBF8A078B78D53E5D241F509FD8C</code></pre>
<pre><code>auth_key = 918EF0F9DCE0F0683826A7F9D24AE2C030AB787C0D3470DF5CBCDC6DB18972A570B191CA02C10D35534861D429B65D2467ED0DE42EA40C27B204AB97F462176B32462B4717FCC82792082B7201323E5CED8FEA6B516C88BE88DFAFA5C3C93B90E61ED63B4F62FFE845B192DCB85F3397FB631CEB240860EE6FE09DC06846899BE78AA8144416CF4743C1CF9B32FB769665979E85CFC8C6A6E96A687FBA1B41D6006F461F30E3435761C370C4E30B5DFCD35C880326CADFDDCBDE404C95E6EDECF4D1C75117F06E9381DC030B68E48D93C41A8ED5CD946D1226256A36B6FCBB75351CF201612D42525431B7C92FD2AA1366E708617758C27F95C529FEDFABF0BE</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C0 EE 08 A1 A1 38 67
0010 | 34 00 00 00 34 F7 CB 3B F3 C6 F3 84 6F CA 4D 6D
0020 | 5F 17 DC 5D C0 1C 36 7F BC D0 94 5F A8 89 89 60
0030 | F8 CD 69 F5 8E 1F 39 63 72 B9 66 1F DB 86 E9 F0
0040 | 49 C9 31 A9 01 6F 6C 39</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>01C4015035733867</code></td>
<td><code>01C0EE08A1A13867</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>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td><code>F3C6F3846FCA4D6D5F17DC5DC01C367F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td><code>BCD0945FA8898960F8CD69F58E1F3963</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>755FB43E0210FD8814F2BA248D9892BD</code></td>
<td><code>72B9661FDB86E9F049C931A9016F6C39</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

@ -641,7 +641,7 @@
</tr>
<tr>
<td><a href="/method/messages.sendPaidReaction">messages.sendPaidReaction</a></td>
<td> </td>
<td>Sends one or more <a href="/api/reactions#paid-reactions">paid Telegram Star reactions »</a>, transferring <a href="/api/stars">Telegram Stars »</a> to a channel's balance.</td>
</tr>
<tr>
<td><a href="/method/messages.getPaidReactionPrivacy">messages.getPaidReactionPrivacy</a></td>