Update content of files

This commit is contained in:
GitHub Action 2024-06-24 18:51:58 +00:00
parent 1699ec558b
commit e1b3dcc394
6 changed files with 242 additions and 232 deletions

View file

@ -572,7 +572,7 @@
<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/messages.getOutboxReadDate">messages.getOutboxReadDate</a> - </li>
<li>Added <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a> - </li>
<li>Added <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a> - Check whether we can write to the specified user (non-<a href="/api/premium">Premium</a> users only).</li>
<li>Added <a href="/method/channels.setBoostsToUnblockRestrictions">channels.setBoostsToUnblockRestrictions</a> - </li>
<li>Added <a href="/method/channels.setEmojiStickers">channels.setEmojiStickers</a> - </li>
</ul>

View file

@ -89,12 +89,12 @@
<tr>
<td><strong>hide_read_marks</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/constructor/true">true</a></td>
<td>If set, (only) users that cannot see <em>our</em> exact last online date due to the current value of the <a href="/constructor/inputPrivacyKeyStatusTimestamp">inputPrivacyKeyStatusTimestamp</a> key will receive a <code>403</code> <code>USER_PRIVACY_RESTRICTED</code> error when invoking <a href="/method/messages.getOutboxReadDate">messages.getOutboxReadDate</a> to fetch the exact read date of one of their messages. <br>The <a href="/constructor/userFull">userFull</a>.<code>read_dates_private</code> flag will be set for users that have this flag enabled.</td>
<td>If set, (only) users that cannot see <em>our</em> exact last online date due to the current value of the <a href="/constructor/inputPrivacyKeyStatusTimestamp">inputPrivacyKeyStatusTimestamp</a> key will receive a <code>403 USER_PRIVACY_RESTRICTED</code> error when invoking <a href="/method/messages.getOutboxReadDate">messages.getOutboxReadDate</a> to fetch the exact read date of one of their messages. <br>The <a href="/constructor/userFull">userFull</a>.<code>read_dates_private</code> flag will be set for users that have this flag enabled.</td>
</tr>
<tr>
<td><strong>new_noncontact_peers_require_premium</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/constructor/true">true</a></td>
<td>If set, only users that have a premium account, are in our contact list, or already have a private chat with us can write to us privately; a <code>403</code> <code>PRIVACY_PREMIUM_REQUIRED</code> error will be emitted otherwise. <br>The <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code> flag will be set for users that have this flag enabled. <br><a href="/api/premium">Premium</a> users only, non-Premium users will receive a <code>PREMIUM_ACCOUNT_REQUIRED</code> error when trying to enable this flag.</td>
<td>If set, only users that have a premium account, are in our contact list, or already have a private chat with us can write to us; a <code>403 PRIVACY_PREMIUM_REQUIRED</code> error will be emitted otherwise. <br>The <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code> flag will be set for users that have this flag enabled. <br>To check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <a href="/constructor/userFull">userFull</a> or history of all users while displaying the chat list in the sharing UI) the <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a> method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. <br><a href="/api/premium">Premium</a> users only, non-Premium users will receive a <code>PREMIUM_ACCOUNT_REQUIRED</code> error when trying to enable this flag.</td>
</tr>
</tbody>
</table>
@ -109,6 +109,12 @@
<h4><a class="anchor" href="#messagesgetoutboxreaddate" id="messagesgetoutboxreaddate" name="messagesgetoutboxreaddate"><i class="anchor-icon"></i></a><a href="/method/messages.getOutboxReadDate">messages.getOutboxReadDate</a></h4>
<h4><a class="anchor" href="#userfull" id="userfull" name="userfull"><i class="anchor-icon"></i></a><a href="/constructor/userFull">userFull</a></h4>
<p>Extended user info</p>
<h4><a class="anchor" href="#usersgetispremiumrequiredtocontact" id="usersgetispremiumrequiredtocontact" name="usersgetispremiumrequiredtocontact"><i class="anchor-icon"></i></a><a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a></h4>
<p>Check whether we can write to the specified user (non-<a href="/api/premium">Premium</a> users only).</p>
<p>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code>, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private.</p>
<p>To easily check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <a href="/constructor/userFull">userFull</a> or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user.</p>
<p>This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.</p>
<p>Note that this method should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information + contact information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</p>
<h4><a class="anchor" href="#telegram-premium" id="telegram-premium" name="telegram-premium"><i class="anchor-icon"></i></a><a href="/api/premium">Telegram Premium</a></h4>
<p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.</p></div>

View file

@ -129,7 +129,7 @@
<tr>
<td><strong>contact_require_premium</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.29?<a href="/constructor/true">true</a></td>
<td>If set, we can only write to this user if we already have a private chat with them, if we are subscribed to <a href="/api/premium">Telegram Premium</a>, or if they're a mutual contact (<a href="/constructor/user">user</a>.<code>mutual_contact</code>). <br>All the secondary conditions listed above must be checked separately to verify whether we can still write to the user, even if this flag is set (i.e. a mutual contact will have this flag set even if we can still write to them, and so on...). <br>To set this flag for ourselves invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>, setting the <code>settings.new_noncontact_peers_require_premium</code> flag.</td>
<td>If set, we can only write to this user if they have already sent some messages to us, if we are subscribed to <a href="/api/premium">Telegram Premium</a>, or if they're a mutual contact (<a href="/constructor/user">user</a>.<code>mutual_contact</code>). <br>All the secondary conditions listed above must be checked separately to verify whether we can still write to the user, even if this flag is set (i.e. a mutual contact will have this flag set even if we can still write to them, and so on...); to avoid doing these extra checks if we haven't yet cached all the required information (for example while displaying the chat list in the sharing UI) the <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a> method may be invoked instead, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. <br>To set this flag for ourselves invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>, setting the <code>settings.new_noncontact_peers_require_premium</code> flag.</td>
</tr>
<tr>
<td><strong>read_dates_private</strong></td>
@ -302,6 +302,12 @@
<p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.</p>
<h4><a class="anchor" href="#user" id="user" name="user"><i class="anchor-icon"></i></a><a href="/constructor/user">user</a></h4>
<p>Indicates info about a certain user</p>
<h4><a class="anchor" href="#usersgetispremiumrequiredtocontact" id="usersgetispremiumrequiredtocontact" name="usersgetispremiumrequiredtocontact"><i class="anchor-icon"></i></a><a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a></h4>
<p>Check whether we can write to the specified user (non-<a href="/api/premium">Premium</a> users only).</p>
<p>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code>, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private.</p>
<p>To easily check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <a href="/constructor/userFull">userFull</a> or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user.</p>
<p>This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.</p>
<p>Note that this method should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information + contact information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</p>
<h4><a class="anchor" href="#accountsetglobalprivacysettings" id="accountsetglobalprivacysettings" name="accountsetglobalprivacysettings"><i class="anchor-icon"></i></a><a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a></h4>
<p>Set global privacy settings</p>
<h4><a class="anchor" href="#messagesgetoutboxreaddate" id="messagesgetoutboxreaddate" name="messagesgetoutboxreaddate"><i class="anchor-icon"></i></a><a href="/method/messages.getOutboxReadDate">messages.getOutboxReadDate</a></h4>

View file

@ -4,26 +4,10 @@
<meta charset="utf-8">
<title>users.getIsPremiumRequiredToContact</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
id
Vector&lt;InputUser&gt;
 
Result
Vector&lt;Bool&gt;">
<meta property="description" content="Check whether we can write to the specified user (non-Premium users only). If a user enables their new_noncontact_peers_require_premium global privacy setting, represented in userFull.contact_require_premium, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private. To easily check whether we can write to a user with this flag enabled, if we haven&#39;t yet cached all the required information (for example we don&#39;t have the userFull or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a Premium subscription. Note that this method should only be invoked if we don&#39;t have a Premium subscription, for users whose full info (userFull + message history information + contact information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual updates.">
<meta property="og:title" content="users.getIsPremiumRequiredToContact">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
id
Vector&lt;InputUser&gt;
 
Result
Vector&lt;Bool&gt;">
<meta property="og:description" content="Check whether we can write to the specified user (non-Premium users only). If a user enables their new_noncontact_peers_require_premium global privacy setting, represented in userFull.contact_require_premium, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private. To easily check whether we can write to a user with this flag enabled, if we haven&#39;t yet cached all the required information (for example we don&#39;t have the userFull or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a Premium subscription. Note that this method should only be invoked if we don&#39;t have a Premium subscription, for users whose full info (userFull + message history information + contact information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual updates.">
<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">
@ -58,7 +42,12 @@ Vector&lt;Bool&gt;">
<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/users.getIsPremiumRequiredToContact" >users.getIsPremiumRequiredToContact</a></li></ul></div>
<h1 id="dev_page_title">users.getIsPremiumRequiredToContact</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Check whether we can write to the specified user (non-<a href="/api/premium">Premium</a> users only).</p>
<p>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code>, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private.</p>
<p>To easily check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <a href="/constructor/userFull">userFull</a> or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user.</p>
<p>This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.</p>
<p>Note that this method should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, only for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 181 <b class="caret"></b></a>
@ -85,12 +74,21 @@ Vector&lt;Bool&gt;">
<tr>
<td><strong>id</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/InputUser">InputUser</a>&gt;</td>
<td> </td>
<td>Users to fetch info about.</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/Vector%20t">Vector</a>&lt;<a href="/type/Bool">Bool</a>&gt;</p></div>
<p><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/Bool">Bool</a>&gt;</p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#telegram-premium" id="telegram-premium" name="telegram-premium"><i class="anchor-icon"></i></a><a href="/api/premium">Telegram Premium</a></h4>
<p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.</p>
<h4><a class="anchor" href="#privacy" id="privacy" name="privacy"><i class="anchor-icon"></i></a><a href="/api/privacy">Privacy</a></h4>
<p>Telegram allows users to specify granular privacy settings, choosing which users can or can't interact with them in certain ways.</p>
<h4><a class="anchor" href="#userfull" id="userfull" name="userfull"><i class="anchor-icon"></i></a><a href="/constructor/userFull">userFull</a></h4>
<p>Extended user info</p>
<h4><a class="anchor" href="#working-with-updates" id="working-with-updates" name="working-with-updates"><i class="anchor-icon"></i></a><a href="/api/updates">Working with Updates</a></h4>
<p>How to subscribe to updates and handle them properly.</p></div>
</div>

View file

@ -3178,7 +3178,7 @@ Look for updates of telegram&#39;s terms of service…">
</tr>
<tr>
<td><a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a></td>
<td> </td>
<td>Check whether we can write to the specified user (non-<a href="/api/premium">Premium</a> users only).<br><br>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code>, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private.<br><br>To easily check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <a href="/constructor/userFull">userFull</a> or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user.<br><br>This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.<br><br>Note that this method should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information + contact information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</td>
</tr>
<tr>
<td><a href="/method/channels.setBoostsToUnblockRestrictions">channels.setBoostsToUnblockRestrictions</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 78 F5 04 00 C6 B6 79 66
0010 | 14 00 00 00 F1 8E 7E BE FF 94 B2 49 02 3B A8 8D
0020 | A0 2F D6 95 79 D7 C4 03</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 14 E9 05 00 50 BA 79 66
0010 | 14 00 00 00 F1 8E 7E BE 89 66 1B 73 7A 31 36 75
0020 | 4D C8 B0 EE C3 20 B4 5A</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>78F50400C6B67966</code></td>
<td><code>14E9050050BA7966</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>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</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 9C EB C6 C6 B6 79 66
0010 | B0 00 00 00 63 24 16 05 FF 94 B2 49 02 3B A8 8D
0020 | A0 2F D6 95 79 D7 C4 03 C7 A1 D4 5C 25 AF 92 79
0030 | BD 9C 96 D7 14 48 D3 D3 08 32 01 38 70 1C 37 8F
0040 | E7 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D0 71 60 50 BA 79 66
0010 | A4 00 00 00 63 24 16 05 89 66 1B 73 7A 31 36 75
0020 | 4D C8 B0 EE C3 20 B4 5A 5B 48 21 9D 38 80 3F AC
0030 | A0 A5 21 5A 41 BD 8B 78 08 1C 7D 70 DB 91 B6 E5
0040 | BD 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
0060 | 85 1D 9D D0</code></pre>
<p>Payload (de)serialization:</p>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>019CEBC6C6B67966</code></td>
<td><code>01D0716050BA7966</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>B0000000</code> (176 in decimal)</td>
<td><code>A4000000</code> (164 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>C7A1D45C25AF9279BD9C96D71448D3D3</code></td>
<td><code>5B48219D38803FACA0A5215A41BD8B78</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>08320138701C378FE7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3603223231034003431</td>
<td><code>081C7D70DB91B6E5BD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2052921093495645629</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 = 3603223231034003431</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>3603223231034003431 = 1836149899 * 1962379669</code></p>
<pre><code>p = 1836149899
q = 1962379669</code></pre>
<pre><code>pq = 2052921093495645629</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2052921093495645629 = 1354718059 * 1515386231</code></p>
<pre><code>p = 1354718059
q = 1515386231</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 32 01 38 70 1C 37 8F E7 00 00 00
0010 | 04 6D 71 6C 8B 00 00 00 04 74 F7 89 95 00 00 00
0020 | FF 94 B2 49 02 3B A8 8D A0 2F D6 95 79 D7 C4 03
0030 | C7 A1 D4 5C 25 AF 92 79 BD 9C 96 D7 14 48 D3 D3
0040 | 6B C1 60 F4 87 3A 17 B4 41 99 86 B0 8B B5 CF 9D
0050 | 8E 2B FD 9B BC B6 B0 BB BA 79 63 4F 14 4B AA 69
<pre><code>0000 | 95 5F F5 A9 08 1C 7D 70 DB 91 B6 E5 BD 00 00 00
0010 | 04 50 BF 5B 6B 00 00 00 04 5A 52 F5 77 00 00 00
0020 | 89 66 1B 73 7A 31 36 75 4D C8 B0 EE C3 20 B4 5A
0030 | 5B 48 21 9D 38 80 3F AC A0 A5 21 5A 41 BD 8B 78
0040 | 0A F0 B6 F6 4E 8F E8 F2 D6 0F A2 BB B5 E8 F2 FE
0050 | 14 F5 D1 91 D7 FA 92 F2 D4 B2 3E 28 E0 01 7A B8
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 = 1962379669</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>08320138701C378FE7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3603223231034003431</td>
<td><code>081C7D70DB91B6E5BD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2052921093495645629</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>046D716C8B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1836149899</td>
<td><code>0450BF5B6B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1354718059</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>0474F78995000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1962379669</td>
<td><code>045A52F577000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1515386231</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>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>C7A1D45C25AF9279BD9C96D71448D3D3</code></td>
<td><code>5B48219D38803FACA0A5215A41BD8B78</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>6BC160F4873A17B4419986B08BB5CF9D</code> <code>8E2BFD9BBCB6B0BBBA79634F144BAA69</code></td>
<td><code>0AF0B6F64E8FE8F2D60FA2BBB5E8F2FE</code> <code>14F5D191D7FA92F2D4B23E28E0017AB8</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1962379669</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 = 955FF5A908320138701C378FE7000000046D716C8B0000000474F78995000000FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D36BC160F4873A17B4419986B08BB5CF9D8E2BFD9BBCB6B0BBBA79634F144BAA6902000000
random_padding_bytes = 16AFBBFE92AA5DAD2952669F45527DAEE2CDB5B7DDFCD25E96D30906E70C51606BEF23B8BEE2982D39C5B3E0AA6DCFB66490C8202EE3DC2B7EA96890477C73354A52C01844D5DE73921F1927ED5904B08504BE82A584A790D9EC89A5</code></pre>
<pre><code>data = 955FF5A9081C7D70DB91B6E5BD0000000450BF5B6B000000045A52F57700000089661B737A3136754DC8B0EEC320B45A5B48219D38803FACA0A5215A41BD8B780AF0B6F64E8FE8F2D60FA2BBB5E8F2FE14F5D191D7FA92F2D4B23E28E0017AB802000000
random_padding_bytes = 6CCA66CCAF62B0BB0599E2F5DE10691D5A10DBFCD912E1A63001EA8D470AAB043B0257CC87F2CE6E41DF9CB1462D77EBBF0DEE2902F4C8D15ED2B16E74CB09C279824B7F3E0F09B502C44A103F175F2E433E6BD283D315FDB327CD5A</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 = 31C92146F1B94380574226D5EC6C1BCBC4910E59555579617F895839C7098547752E8CF5ACDBC06FBA43164ACD9C359E17508F7C290C13E53FE3B4DD709BBEED1B48566CDE6D35D34A13B2270FFF7B98E89FF02935E034B6734EC3ACDD74550ADD68B26FC919A738E56A200D5E844C5E365931056FCD04758423124DA67EC19C826D07E6C7559F02C2D2E342E990B1237F1D38ECAAAF048100EEC0CFAC2D0E67B04D3F66FB5D4D0ABF2440E57EEA03FC670311E411ED344B99DC8A9CC06278B994B30FA30A50675E0AEE1BD47D0C3C75862C82781E27D15C29EC342B37AD07F9BF362CC538AD3513C7DF8FD77E828820E924A16EA081C3F5AFB1B79C7E58EE60</code></pre>
<pre><code>encrypted_data = 4F980F1D38DBF00E09661EB020E3D27B7E45FBEDB51AC1EBC25E7E805E1445A8443773CEC2D18ECE2F36A2F527475A0B0F19F6899BA1B63E33AE4BF039465C9B04965954EB2B0C6D42F36A9D7D134BB0A3B2E82E516A6585E3FD6BCE0931A2214ECFDB88B92049FE2CC3A935263BAA426A0F49A8FB178ACD76E7733F1F7C8FE599461D287CE9E90D6972D1B1012ED3ED0BA5D8656D132930651982882B1E81D26496F716C388FED4E5459C8DFBC68396C66E21D472B5DF6E0173222D81EBBF19FF5B3979F1B2C24061FBADF90EAE632437F17EC8526E45AFEE11A9D9FCEABDDFCCA928F36D75F25831E60E2A887C08530C9F206FB9FC72FF6D3D76FC8E18C60E</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 F8 52 0D 00 C6 B6 79 66
0010 | 40 01 00 00 BE E4 12 D7 FF 94 B2 49 02 3B A8 8D
0020 | A0 2F D6 95 79 D7 C4 03 C7 A1 D4 5C 25 AF 92 79
0030 | BD 9C 96 D7 14 48 D3 D3 04 6D 71 6C 8B 00 00 00
0040 | 04 74 F7 89 95 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 31 C9 21 46 F1 B9 43 80 57 42 26 D5
0060 | EC 6C 1B CB C4 91 0E 59 55 55 79 61 7F 89 58 39
0070 | C7 09 85 47 75 2E 8C F5 AC DB C0 6F BA 43 16 4A
0080 | CD 9C 35 9E 17 50 8F 7C 29 0C 13 E5 3F E3 B4 DD
0090 | 70 9B BE ED 1B 48 56 6C DE 6D 35 D3 4A 13 B2 27
00A0 | 0F FF 7B 98 E8 9F F0 29 35 E0 34 B6 73 4E C3 AC
00B0 | DD 74 55 0A DD 68 B2 6F C9 19 A7 38 E5 6A 20 0D
00C0 | 5E 84 4C 5E 36 59 31 05 6F CD 04 75 84 23 12 4D
00D0 | A6 7E C1 9C 82 6D 07 E6 C7 55 9F 02 C2 D2 E3 42
00E0 | E9 90 B1 23 7F 1D 38 EC AA AF 04 81 00 EE C0 CF
00F0 | AC 2D 0E 67 B0 4D 3F 66 FB 5D 4D 0A BF 24 40 E5
0100 | 7E EA 03 FC 67 03 11 E4 11 ED 34 4B 99 DC 8A 9C
0110 | C0 62 78 B9 94 B3 0F A3 0A 50 67 5E 0A EE 1B D4
0120 | 7D 0C 3C 75 86 2C 82 78 1E 27 D1 5C 29 EC 34 2B
0130 | 37 AD 07 F9 BF 36 2C C5 38 AD 35 13 C7 DF 8F D7
0140 | 7E 82 88 20 E9 24 A1 6E A0 81 C3 F5 AF B1 B7 9C
0150 | 7E 58 EE 60</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 34 E4 0B 00 50 BA 79 66
0010 | 40 01 00 00 BE E4 12 D7 89 66 1B 73 7A 31 36 75
0020 | 4D C8 B0 EE C3 20 B4 5A 5B 48 21 9D 38 80 3F AC
0030 | A0 A5 21 5A 41 BD 8B 78 04 50 BF 5B 6B 00 00 00
0040 | 04 5A 52 F5 77 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 4F 98 0F 1D 38 DB F0 0E 09 66 1E B0
0060 | 20 E3 D2 7B 7E 45 FB ED B5 1A C1 EB C2 5E 7E 80
0070 | 5E 14 45 A8 44 37 73 CE C2 D1 8E CE 2F 36 A2 F5
0080 | 27 47 5A 0B 0F 19 F6 89 9B A1 B6 3E 33 AE 4B F0
0090 | 39 46 5C 9B 04 96 59 54 EB 2B 0C 6D 42 F3 6A 9D
00A0 | 7D 13 4B B0 A3 B2 E8 2E 51 6A 65 85 E3 FD 6B CE
00B0 | 09 31 A2 21 4E CF DB 88 B9 20 49 FE 2C C3 A9 35
00C0 | 26 3B AA 42 6A 0F 49 A8 FB 17 8A CD 76 E7 73 3F
00D0 | 1F 7C 8F E5 99 46 1D 28 7C E9 E9 0D 69 72 D1 B1
00E0 | 01 2E D3 ED 0B A5 D8 65 6D 13 29 30 65 19 82 88
00F0 | 2B 1E 81 D2 64 96 F7 16 C3 88 FE D4 E5 45 9C 8D
0100 | FB C6 83 96 C6 6E 21 D4 72 B5 DF 6E 01 73 22 2D
0110 | 81 EB BF 19 FF 5B 39 79 F1 B2 C2 40 61 FB AD F9
0120 | 0E AE 63 24 37 F1 7E C8 52 6E 45 AF EE 11 A9 D9
0130 | FC EA BD DF CC A9 28 F3 6D 75 F2 58 31 E6 0E 2A
0140 | 88 7C 08 53 0C 9F 20 6F B9 FC 72 FF 6D 3D 76 FC
0150 | 8E 18 C6 0E</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 = 16AFBBFE92AA5DAD2952669F45527DAEE2CDB5B7DDFCD25E96D30906E
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>F8520D00C6B67966</code></td>
<td><code>34E40B0050BA7966</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 = 16AFBBFE92AA5DAD2952669F45527DAEE2CDB5B7DDFCD25E96D30906E
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>C7A1D45C25AF9279BD9C96D71448D3D3</code></td>
<td><code>5B48219D38803FACA0A5215A41BD8B78</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>046D716C8B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1836149899</td>
<td><code>0450BF5B6B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1354718059</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>0474F78995000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1962379669</td>
<td><code>045A52F577000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1515386231</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 = 16AFBBFE92AA5DAD2952669F45527DAEE2CDB5B7DDFCD25E96D30906E
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE00010031C92146F1B94380574226D5</code> <code>EC6C1BCBC4910E59555579617F895839</code> <code>C7098547752E8CF5ACDBC06FBA43164A</code> <code>CD9C359E17508F7C290C13E53FE3B4DD</code> <code>709BBEED1B48566CDE6D35D34A13B227</code> <code>0FFF7B98E89FF02935E034B6734EC3AC</code> <code>DD74550ADD68B26FC919A738E56A200D</code> <code>5E844C5E365931056FCD04758423124D</code> <code>A67EC19C826D07E6C7559F02C2D2E342</code> <code>E990B1237F1D38ECAAAF048100EEC0CF</code> <code>AC2D0E67B04D3F66FB5D4D0ABF2440E5</code> <code>7EEA03FC670311E411ED344B99DC8A9C</code> <code>C06278B994B30FA30A50675E0AEE1BD4</code> <code>7D0C3C75862C82781E27D15C29EC342B</code> <code>37AD07F9BF362CC538AD3513C7DF8FD7</code> <code>7E828820E924A16EA081C3F5AFB1B79C</code><br> <code>7E58EE60</code></td>
<td><code>FE0001004F980F1D38DBF00E09661EB0</code> <code>20E3D27B7E45FBEDB51AC1EBC25E7E80</code> <code>5E1445A8443773CEC2D18ECE2F36A2F5</code> <code>27475A0B0F19F6899BA1B63E33AE4BF0</code> <code>39465C9B04965954EB2B0C6D42F36A9D</code> <code>7D134BB0A3B2E82E516A6585E3FD6BCE</code> <code>0931A2214ECFDB88B92049FE2CC3A935</code> <code>263BAA426A0F49A8FB178ACD76E7733F</code> <code>1F7C8FE599461D287CE9E90D6972D1B1</code> <code>012ED3ED0BA5D8656D13293065198288</code> <code>2B1E81D26496F716C388FED4E5459C8D</code> <code>FBC68396C66E21D472B5DF6E0173222D</code> <code>81EBBF19FF5B3979F1B2C24061FBADF9</code> <code>0EAE632437F17EC8526E45AFEE11A9D9</code> <code>FCEABDDFCCA928F36D75F25831E60E2A</code> <code>887C08530C9F206FB9FC72FF6D3D76FC</code><br> <code>8E18C60E</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 16AFBBFE92AA5DAD2952669F45527DAEE2CDB5B7DDFCD25E96D30906E
<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 C4 7C 85 C7 B6 79 66
0010 | 9C 02 00 00 5C 07 E8 D0 FF 94 B2 49 02 3B A8 8D
0020 | A0 2F D6 95 79 D7 C4 03 C7 A1 D4 5C 25 AF 92 79
0030 | BD 9C 96 D7 14 48 D3 D3 FE 50 02 00 AC 77 CB FE
0040 | 83 8D E1 17 44 AE 4F 4F 6A 58 07 51 2D 70 3C 94
0050 | 47 33 A3 2E 97 2A AB 59 60 CA F2 63 73 97 09 AA
0060 | D4 16 E5 5D FF B2 FB CF 33 BC 68 B4 63 33 12 C4
0070 | C7 82 85 04 70 C2 3B 0B 9A 26 B5 13 BA 0D B0 B0
0080 | 96 DB 4F 81 0B E9 02 F5 7D 82 44 8E 55 C5 A2 7B
0090 | FC B1 94 70 9B D9 31 C8 9D 8C 33 69 8C A5 16 1E
00A0 | 56 24 69 45 55 8E 0A C4 59 B4 FD 34 20 13 51 8D
00B0 | A2 F8 4B B7 FC E7 30 CD 9E A9 8C 97 9C E4 00 01
00C0 | 0E 1B 40 99 08 E7 DD 8A 98 B7 50 53 69 F7 22 1A
00D0 | 58 4E 83 15 E7 68 68 44 5C 4B CB 80 4C E8 DE D7
00E0 | DE CF 1F 73 4D 51 F1 96 C9 06 15 DF 6E 28 15 88
00F0 | 48 20 32 A7 39 8B 58 AB 2B 84 3A E2 E1 54 83 AF
0100 | 15 FB 46 16 ED A7 79 21 B1 32 51 91 42 33 10 51
0110 | 11 F3 CE 13 2E AA D7 1A 41 CE F2 F2 BC 46 2F CB
0120 | EC 2E 91 60 FB 7B E0 88 FF 3E 82 17 24 94 21 B7
0130 | 8B 22 4A A8 4D 73 28 3F 0E 0A 6D F7 65 A6 13 C7
0140 | 9D 5C 2B 74 EB 48 D0 DA B5 75 B0 DA 6A 8C EC FC
0150 | 04 6B 74 56 73 98 58 E1 40 87 6D 6D 64 C8 13 46
0160 | BE 8C 62 1A D8 32 C5 79 0B 44 82 AA 99 F9 EC D6
0170 | 39 F2 E1 19 F8 E9 0B 2C FE 3F 25 59 C4 48 90 16
0180 | A7 DC 50 4F 10 90 10 53 E9 EA F8 A7 1E 37 5F 22
0190 | A2 76 2A 17 CA CA 64 7C 5A AE 72 4D EF C7 43 10
01A0 | 30 19 66 4A 26 6B 9C 4B D6 BE D9 D2 9E 8C CC 41
01B0 | BF EC 4E 91 63 9F 12 82 3A 5B 70 9B 1C 94 1A DE
01C0 | BF 2B 07 DB 33 E5 9F E5 17 8B F1 11 DA 78 C3 84
01D0 | 89 C9 F2 1B BF 0B 30 DA C3 9E 34 A0 60 38 8C DC
01E0 | F8 BF A4 02 39 DC A5 1D 4E B4 AD AB 45 E8 93 F9
01F0 | 1B 9B F4 F5 A2 82 39 8F 63 D1 AA DD A7 03 43 19
0200 | EA 83 9A 94 86 A2 77 B1 6C FB CC EB 20 F7 D5 12
0210 | 32 1B 03 C3 32 92 9E 42 2D EF C6 FF 5A 9D 57 62
0220 | 8B 61 D8 F4 11 2F 42 B5 7C 83 8B 64 03 EE 21 4F
0230 | 77 87 6D 85 5D FC 81 F9 4F C4 F7 64 A7 55 86 32
0240 | FA A3 20 DA 1A 66 97 D9 41 C9 D8 3A 06 19 0E 76
0250 | 79 E6 A9 90 6B C2 13 E3 59 6F 14 15 46 71 CD 71
0260 | DE FA BA 89 18 23 55 56 3C 44 38 60 83 D1 8E 90
0270 | F0 AA D2 DD 05 E9 04 A0 E6 0A 2E 0E 6C 5C 88 E6
0280 | CA 48 0E B0 6C 2D 4B 90 05 9B E2 ED</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C8 73 28 51 BA 79 66
0010 | D8 02 00 00 5C 07 E8 D0 89 66 1B 73 7A 31 36 75
0020 | 4D C8 B0 EE C3 20 B4 5A 5B 48 21 9D 38 80 3F AC
0030 | A0 A5 21 5A 41 BD 8B 78 FE 50 02 00 78 00 8C 2C
0040 | 3C 3A 14 87 B7 55 24 DA 42 CB 21 0A D1 35 66 77
0050 | 6A 35 1E 40 BB 80 CF 1D E8 B7 E3 F5 E4 B9 81 40
0060 | 81 52 8D 9C 13 9B 07 BF 94 8D E1 A3 82 62 5A ED
0070 | 30 F2 23 73 C8 43 66 25 EE 0D 19 6F 43 4B BC DD
0080 | 7A 0C C5 7F 31 26 B6 0E DC 5D E4 74 D8 43 5C ED
0090 | A3 52 C5 CC D0 06 07 FA 01 59 03 E2 2D 86 33 46
00A0 | D6 17 19 E4 39 AD 8D E1 58 C3 E5 D2 77 E6 A9 D6
00B0 | 2F 15 50 8F 55 06 CA A3 03 A1 0B E0 35 27 DB A3
00C0 | 11 B7 8C 41 FB 15 27 5B CE 99 3F 67 16 D5 C4 0D
00D0 | 1A DD 5B 43 3E 93 34 EB 79 D2 56 59 DE 74 C7 EF
00E0 | 81 B9 2E F2 E9 69 D3 AC 2F AC A0 C4 6B D3 DE 12
00F0 | 08 BA 71 A2 65 9D CB AE 03 A0 A7 63 5C C7 AC 32
0100 | 2B 75 FC C7 0B 31 87 52 F3 30 E0 2E 5E 44 2D 8D
0110 | 10 C1 38 AB 98 A4 3D 18 60 9D F4 0B 35 DA CE 07
0120 | 17 C1 D5 A4 EE A5 7D 9C 19 15 ED 87 3B 51 50 99
0130 | 91 57 4F BC B1 7F 79 60 DE 2B 10 3D 8B C1 7A 79
0140 | 6C 1F C5 07 D8 F0 B9 E6 98 C8 F0 C2 55 70 9B D6
0150 | F5 C7 79 54 28 D2 FF 2B 8A 85 ED 31 0F 18 32 00
0160 | 32 BE 38 82 5A C7 C0 F1 D9 01 6B 0D 3E 11 2C B0
0170 | 11 90 28 3C 08 20 0E 60 7E 6B B6 75 F2 CD 9D EF
0180 | A6 A4 73 F3 44 A9 8E 12 DA 1A 7F 14 E1 DF 32 F4
0190 | BC 7F 21 A6 5C 64 D1 C2 34 E4 A5 AE 63 FD E9 9E
01A0 | B4 F4 D4 77 A9 57 87 AE 0B 78 49 0C 3E A6 EC 6E
01B0 | 96 F0 DB E7 F3 27 E1 93 1B B9 75 61 3D 5F 9D 6B
01C0 | 6D 8F CD 14 D3 E1 85 CE C2 EF A4 D3 40 A9 A5 95
01D0 | C2 6B 54 5F 59 F3 F7 3E AC 32 34 97 40 29 39 85
01E0 | F9 D1 FE 1F 16 CD C0 44 1A 1B BF D8 51 30 6E C6
01F0 | C7 2D 82 E3 46 E6 44 98 A8 BB 38 4C F2 FE 45 08
0200 | 81 3F F8 99 A9 3B 50 A8 CB 86 01 0B F3 2A 71 D9
0210 | 0E E9 00 32 0A EB D8 9B 85 F8 80 32 FC 1B CA 09
0220 | CE 46 B5 49 A2 45 34 AB 7A 71 98 9A 1B F2 35 E6
0230 | 06 7B 5C 11 14 70 96 67 F4 25 A6 39 57 FD 5D 23
0240 | B8 BC 6B 25 58 9D 3E 17 29 84 EC 7D 35 38 BC 91
0250 | C9 D3 5C A0 1A D5 91 97 8B 90 3B 9B 1C 62 DE CC
0260 | F0 2B 7A 69 5D A6 B8 DB 7A CA 36 04 A1 73 91 DC
0270 | 18 2A 60 32 33 7A 8A 77 31 BA 16 4D 09 11 56 35
0280 | 9A D5 CA AD 1C 1E B3 5E 6C 54 6B 26</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
<table class="table">
@ -464,13 +464,13 @@ random_padding_bytes = 16AFBBFE92AA5DAD2952669F45527DAEE2CDB5B7DDFCD25E96D30906E
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01C47C85C7B67966</code></td>
<td><code>01C8732851BA7966</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>9C020000</code> (668 in decimal)</td>
<td><code>D8020000</code> (728 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 16AFBBFE92AA5DAD2952669F45527DAEE2CDB5B7DDFCD25E96D30906E
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>C7A1D45C25AF9279BD9C96D71448D3D3</code></td>
<td><code>5B48219D38803FACA0A5215A41BD8B78</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200AC77CBFE838DE11744AE4F4F</code> <code>6A5807512D703C944733A32E972AAB59</code> <code>60CAF263739709AAD416E55DFFB2FBCF</code> <code>33BC68B4633312C4C782850470C23B0B</code> <code>9A26B513BA0DB0B096DB4F810BE902F5</code> <code>7D82448E55C5A27BFCB194709BD931C8</code> <code>9D8C33698CA5161E56246945558E0AC4</code> <code>59B4FD342013518DA2F84BB7FCE730CD</code> <code>9EA98C979CE400010E1B409908E7DD8A</code> <code>98B7505369F7221A584E8315E7686844</code> <code>5C4BCB804CE8DED7DECF1F734D51F196</code> <code>C90615DF6E281588482032A7398B58AB</code> <code>2B843AE2E15483AF15FB4616EDA77921</code> <code>B13251914233105111F3CE132EAAD71A</code> <code>41CEF2F2BC462FCBEC2E9160FB7BE088</code> <code>FF3E8217249421B78B224AA84D73283F</code> <code>0E0A6DF765A613C79D5C2B74EB48D0DA</code> <code>B575B0DA6A8CECFC046B7456739858E1</code> <code>40876D6D64C81346BE8C621AD832C579</code> <code>0B4482AA99F9ECD639F2E119F8E90B2C</code> <code>FE3F2559C4489016A7DC504F10901053</code> <code>E9EAF8A71E375F22A2762A17CACA647C</code> <code>5AAE724DEFC743103019664A266B9C4B</code> <code>D6BED9D29E8CCC41BFEC4E91639F1282</code> <code>3A5B709B1C941ADEBF2B07DB33E59FE5</code> <code>178BF111DA78C38489C9F21BBF0B30DA</code> <code>C39E34A060388CDCF8BFA40239DCA51D</code> <code>4EB4ADAB45E893F91B9BF4F5A282398F</code> <code>63D1AADDA7034319EA839A9486A277B1</code> <code>6CFBCCEB20F7D512321B03C332929E42</code> <code>2DEFC6FF5A9D57628B61D8F4112F42B5</code> <code>7C838B6403EE214F77876D855DFC81F9</code> <code>4FC4F764A7558632FAA320DA1A6697D9</code> <code>41C9D83A06190E7679E6A9906BC213E3</code> <code>596F14154671CD71DEFABA8918235556</code> <code>3C44386083D18E90F0AAD2DD05E904A0</code> <code>E60A2E0E6C5C88E6CA480EB06C2D4B90</code><br> <code>059BE2ED</code></td>
<td><code>FE50020078008C2C3C3A1487B75524DA</code> <code>42CB210AD13566776A351E40BB80CF1D</code> <code>E8B7E3F5E4B9814081528D9C139B07BF</code> <code>948DE1A382625AED30F22373C8436625</code> <code>EE0D196F434BBCDD7A0CC57F3126B60E</code> <code>DC5DE474D8435CEDA352C5CCD00607FA</code> <code>015903E22D863346D61719E439AD8DE1</code> <code>58C3E5D277E6A9D62F15508F5506CAA3</code> <code>03A10BE03527DBA311B78C41FB15275B</code> <code>CE993F6716D5C40D1ADD5B433E9334EB</code> <code>79D25659DE74C7EF81B92EF2E969D3AC</code> <code>2FACA0C46BD3DE1208BA71A2659DCBAE</code> <code>03A0A7635CC7AC322B75FCC70B318752</code> <code>F330E02E5E442D8D10C138AB98A43D18</code> <code>609DF40B35DACE0717C1D5A4EEA57D9C</code> <code>1915ED873B51509991574FBCB17F7960</code> <code>DE2B103D8BC17A796C1FC507D8F0B9E6</code> <code>98C8F0C255709BD6F5C7795428D2FF2B</code> <code>8A85ED310F18320032BE38825AC7C0F1</code> <code>D9016B0D3E112CB01190283C08200E60</code> <code>7E6BB675F2CD9DEFA6A473F344A98E12</code> <code>DA1A7F14E1DF32F4BC7F21A65C64D1C2</code> <code>34E4A5AE63FDE99EB4F4D477A95787AE</code> <code>0B78490C3EA6EC6E96F0DBE7F327E193</code> <code>1BB975613D5F9D6B6D8FCD14D3E185CE</code> <code>C2EFA4D340A9A595C26B545F59F3F73E</code> <code>AC32349740293985F9D1FE1F16CDC044</code> <code>1A1BBFD851306EC6C72D82E346E64498</code> <code>A8BB384CF2FE4508813FF899A93B50A8</code> <code>CB86010BF32A71D90EE900320AEBD89B</code> <code>85F88032FC1BCA09CE46B549A24534AB</code> <code>7A71989A1BF235E6067B5C1114709667</code> <code>F425A63957FD5D23B8BC6B25589D3E17</code> <code>2984EC7D3538BC91C9D35CA01AD59197</code> <code>8B903B9B1C62DECCF02B7A695DA6B8DB</code> <code>7ACA3604A17391DC182A6032337A8A77</code> <code>31BA164D091156359AD5CAAD1C1EB35E</code><br> <code>6C546B26</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 16AFBBFE92AA5DAD2952669F45527DAEE2CDB5B7DDFCD25E96D30906E
<!-- 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 = AC77CBFE838DE11744AE4F4F6A5807512D703C944733A32E972AAB5960CAF263739709AAD416E55DFFB2FBCF33BC68B4633312C4C782850470C23B0B9A26B513BA0DB0B096DB4F810BE902F57D82448E55C5A27BFCB194709BD931C89D8C33698CA5161E56246945558E0AC459B4FD342013518DA2F84BB7FCE730CD9EA98C979CE400010E1B409908E7DD8A98B7505369F7221A584E8315E76868445C4BCB804CE8DED7DECF1F734D51F196C90615DF6E281588482032A7398B58AB2B843AE2E15483AF15FB4616EDA77921B13251914233105111F3CE132EAAD71A41CEF2F2BC462FCBEC2E9160FB7BE088FF3E8217249421B78B224AA84D73283F0E0A6DF765A613C79D5C2B74EB48D0DAB575B0DA6A8CECFC046B7456739858E140876D6D64C81346BE8C621AD832C5790B4482AA99F9ECD639F2E119F8E90B2CFE3F2559C4489016A7DC504F10901053E9EAF8A71E375F22A2762A17CACA647C5AAE724DEFC743103019664A266B9C4BD6BED9D29E8CCC41BFEC4E91639F12823A5B709B1C941ADEBF2B07DB33E59FE5178BF111DA78C38489C9F21BBF0B30DAC39E34A060388CDCF8BFA40239DCA51D4EB4ADAB45E893F91B9BF4F5A282398F63D1AADDA7034319EA839A9486A277B16CFBCCEB20F7D512321B03C332929E422DEFC6FF5A9D57628B61D8F4112F42B57C838B6403EE214F77876D855DFC81F94FC4F764A7558632FAA320DA1A6697D941C9D83A06190E7679E6A9906BC213E3596F14154671CD71DEFABA89182355563C44386083D18E90F0AAD2DD05E904A0E60A2E0E6C5C88E6CA480EB06C2D4B90059BE2ED
tmp_aes_key = B92981189223E79306ED28A79803166CB9955A23AB1278C4F2C911449BCBA10B
tmp_aes_iv = 72CF3E363A1C6658B900F9427A230DC6EA595327438D5C28EB9287336BC160F4</code></pre>
<pre><code>encrypted_answer = 78008C2C3C3A1487B75524DA42CB210AD13566776A351E40BB80CF1DE8B7E3F5E4B9814081528D9C139B07BF948DE1A382625AED30F22373C8436625EE0D196F434BBCDD7A0CC57F3126B60EDC5DE474D8435CEDA352C5CCD00607FA015903E22D863346D61719E439AD8DE158C3E5D277E6A9D62F15508F5506CAA303A10BE03527DBA311B78C41FB15275BCE993F6716D5C40D1ADD5B433E9334EB79D25659DE74C7EF81B92EF2E969D3AC2FACA0C46BD3DE1208BA71A2659DCBAE03A0A7635CC7AC322B75FCC70B318752F330E02E5E442D8D10C138AB98A43D18609DF40B35DACE0717C1D5A4EEA57D9C1915ED873B51509991574FBCB17F7960DE2B103D8BC17A796C1FC507D8F0B9E698C8F0C255709BD6F5C7795428D2FF2B8A85ED310F18320032BE38825AC7C0F1D9016B0D3E112CB01190283C08200E607E6BB675F2CD9DEFA6A473F344A98E12DA1A7F14E1DF32F4BC7F21A65C64D1C234E4A5AE63FDE99EB4F4D477A95787AE0B78490C3EA6EC6E96F0DBE7F327E1931BB975613D5F9D6B6D8FCD14D3E185CEC2EFA4D340A9A595C26B545F59F3F73EAC32349740293985F9D1FE1F16CDC0441A1BBFD851306EC6C72D82E346E64498A8BB384CF2FE4508813FF899A93B50A8CB86010BF32A71D90EE900320AEBD89B85F88032FC1BCA09CE46B549A24534AB7A71989A1BF235E6067B5C1114709667F425A63957FD5D23B8BC6B25589D3E172984EC7D3538BC91C9D35CA01AD591978B903B9B1C62DECCF02B7A695DA6B8DB7ACA3604A17391DC182A6032337A8A7731BA164D091156359AD5CAAD1C1EB35E6C546B26
tmp_aes_key = D95D6D1F73B86C9F2FEE57031834B871E2EB8BB8B07F7DBAD277D94A023BEA0A
tmp_aes_iv = 1FF06E972F99F6F583AD0491DCDF21A68218A8B019B3AFB930D4038E0AF0B6F6</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 122F0BCC970E84F81E1B0E7877EFED5B71E1AF95BA0D89B5FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010062F2AE811E0E1B9DCF3FA2499A356EEC8E942B61E888519CC6309519FA871E75439A28E33CAA3F3E4D8AC20818A5C76633F121D98EFA3BD8250F2D926F310D7E88C205E6092180504C8C4B9027D61492F208B0CF197E4B56067D8FE9F1222D0E3C3C04BE92189932A0AA3A2C910CBBD0C6645FB1972C807D66E012B5FA5EB4A4D8B60E3E59B5F03EB757C5CC4C54ED4E0AD5F07214D70DA97A62A7403B7A32E62B3732501F9B1359230BDF120E4DCF18AB339EE8883E2D800355B0E5F351EAE23FD44B60F649CC293C0039D673ABD9B0708AE9028230BED69DD51DA75C1B8801F597324F3A7CB4683BD609B9BD40DE9D52E0868547C0A9D9F579B6128A62F14EC7B67966AB8328A1388D04BA
answer = BA0D89B5FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010062F2AE811E0E1B9DCF3FA2499A356EEC8E942B61E888519CC6309519FA871E75439A28E33CAA3F3E4D8AC20818A5C76633F121D98EFA3BD8250F2D926F310D7E88C205E6092180504C8C4B9027D61492F208B0CF197E4B56067D8FE9F1222D0E3C3C04BE92189932A0AA3A2C910CBBD0C6645FB1972C807D66E012B5FA5EB4A4D8B60E3E59B5F03EB757C5CC4C54ED4E0AD5F07214D70DA97A62A7403B7A32E62B3732501F9B1359230BDF120E4DCF18AB339EE8883E2D800355B0E5F351EAE23FD44B60F649CC293C0039D673ABD9B0708AE9028230BED69DD51DA75C1B8801F597324F3A7CB4683BD609B9BD40DE9D52E0868547C0A9D9F579B6128A62F14EC7B67966AB8328A1388D04BA</code></pre>
<pre><code>answer_with_hash = 4D02ECFAF65018FBB011DB8FAF59585E41E1D350BA0D89B589661B737A3136754DC8B0EEC320B45A5B48219D38803FACA0A5215A41BD8B7803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004B9393CBF0FC5C756A7B9BC4868E27C112ACE80FC11C35740D11D19DEDD7C9F139C9E14F3AD6AA4E6470B46AFF695C1CFC7488D929A91B812B514B4F155A79E159A0928C38F4FFDB3DD16F02F1A1CDFFA36F6A271D420EF6551EC8CDF352EEB6BB591429C33ACA97251D2ED355785C0DFA7A99690D597620DD1FA7524871C7E83832E9D319C3090BD87573D3AD8463BDA039B7673FA84D9259E2A1EFDAF6A502FBCEDA94E1999E56DCA6D99124A90387F5FEF0065DC3E60E9644609679F27F7126FB171B4EC0456744A6851DFF36CBC036A994A54664412B386AB5FD67144A0EF3448C0A73346E943D65D1BBB9F2DDD6EBDD9926B6106F0AECC8645F435D3F4351BA79666D3FE27357C5B406
answer = BA0D89B589661B737A3136754DC8B0EEC320B45A5B48219D38803FACA0A5215A41BD8B7803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004B9393CBF0FC5C756A7B9BC4868E27C112ACE80FC11C35740D11D19DEDD7C9F139C9E14F3AD6AA4E6470B46AFF695C1CFC7488D929A91B812B514B4F155A79E159A0928C38F4FFDB3DD16F02F1A1CDFFA36F6A271D420EF6551EC8CDF352EEB6BB591429C33ACA97251D2ED355785C0DFA7A99690D597620DD1FA7524871C7E83832E9D319C3090BD87573D3AD8463BDA039B7673FA84D9259E2A1EFDAF6A502FBCEDA94E1999E56DCA6D99124A90387F5FEF0065DC3E60E9644609679F27F7126FB171B4EC0456744A6851DFF36CBC036A994A54664412B386AB5FD67144A0EF3448C0A73346E943D65D1BBB9F2DDD6EBDD9926B6106F0AECC8645F435D3F4351BA79666D3FE27357C5B406</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 FF 94 B2 49 02 3B A8 8D A0 2F D6 95
0010 | 79 D7 C4 03 C7 A1 D4 5C 25 AF 92 79 BD 9C 96 D7
0020 | 14 48 D3 D3 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 89 66 1B 73 7A 31 36 75 4D C8 B0 EE
0010 | C3 20 B4 5A 5B 48 21 9D 38 80 3F AC A0 A5 21 5A
0020 | 41 BD 8B 78 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 = BA0D89B5FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D
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 | 62 F2 AE 81 1E 0E 1B 9D CF 3F A2 49 9A 35 6E EC
0140 | 8E 94 2B 61 E8 88 51 9C C6 30 95 19 FA 87 1E 75
0150 | 43 9A 28 E3 3C AA 3F 3E 4D 8A C2 08 18 A5 C7 66
0160 | 33 F1 21 D9 8E FA 3B D8 25 0F 2D 92 6F 31 0D 7E
0170 | 88 C2 05 E6 09 21 80 50 4C 8C 4B 90 27 D6 14 92
0180 | F2 08 B0 CF 19 7E 4B 56 06 7D 8F E9 F1 22 2D 0E
0190 | 3C 3C 04 BE 92 18 99 32 A0 AA 3A 2C 91 0C BB D0
01A0 | C6 64 5F B1 97 2C 80 7D 66 E0 12 B5 FA 5E B4 A4
01B0 | D8 B6 0E 3E 59 B5 F0 3E B7 57 C5 CC 4C 54 ED 4E
01C0 | 0A D5 F0 72 14 D7 0D A9 7A 62 A7 40 3B 7A 32 E6
01D0 | 2B 37 32 50 1F 9B 13 59 23 0B DF 12 0E 4D CF 18
01E0 | AB 33 9E E8 88 3E 2D 80 03 55 B0 E5 F3 51 EA E2
01F0 | 3F D4 4B 60 F6 49 CC 29 3C 00 39 D6 73 AB D9 B0
0200 | 70 8A E9 02 82 30 BE D6 9D D5 1D A7 5C 1B 88 01
0210 | F5 97 32 4F 3A 7C B4 68 3B D6 09 B9 BD 40 DE 9D
0220 | 52 E0 86 85 47 C0 A9 D9 F5 79 B6 12 8A 62 F1 4E
0230 | C7 B6 79 66</code></pre>
0130 | 4B 93 93 CB F0 FC 5C 75 6A 7B 9B C4 86 8E 27 C1
0140 | 12 AC E8 0F C1 1C 35 74 0D 11 D1 9D ED D7 C9 F1
0150 | 39 C9 E1 4F 3A D6 AA 4E 64 70 B4 6A FF 69 5C 1C
0160 | FC 74 88 D9 29 A9 1B 81 2B 51 4B 4F 15 5A 79 E1
0170 | 59 A0 92 8C 38 F4 FF DB 3D D1 6F 02 F1 A1 CD FF
0180 | A3 6F 6A 27 1D 42 0E F6 55 1E C8 CD F3 52 EE B6
0190 | BB 59 14 29 C3 3A CA 97 25 1D 2E D3 55 78 5C 0D
01A0 | FA 7A 99 69 0D 59 76 20 DD 1F A7 52 48 71 C7 E8
01B0 | 38 32 E9 D3 19 C3 09 0B D8 75 73 D3 AD 84 63 BD
01C0 | A0 39 B7 67 3F A8 4D 92 59 E2 A1 EF DA F6 A5 02
01D0 | FB CE DA 94 E1 99 9E 56 DC A6 D9 91 24 A9 03 87
01E0 | F5 FE F0 06 5D C3 E6 0E 96 44 60 96 79 F2 7F 71
01F0 | 26 FB 17 1B 4E C0 45 67 44 A6 85 1D FF 36 CB C0
0200 | 36 A9 94 A5 46 64 41 2B 38 6A B5 FD 67 14 4A 0E
0210 | F3 44 8C 0A 73 34 6E 94 3D 65 D1 BB B9 F2 DD D6
0220 | EB DD 99 26 B6 10 6F 0A EC C8 64 5F 43 5D 3F 43
0230 | 51 BA 79 66</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
<table class="table">
@ -570,13 +570,13 @@ answer = BA0D89B5FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>C7A1D45C25AF9279BD9C96D71448D3D3</code></td>
<td><code>5B48219D38803FACA0A5215A41BD8B78</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010062F2AE811E0E1B9DCF3FA249</code> <code>9A356EEC8E942B61E888519CC6309519</code> <code>FA871E75439A28E33CAA3F3E4D8AC208</code> <code>18A5C76633F121D98EFA3BD8250F2D92</code> <code>6F310D7E88C205E6092180504C8C4B90</code> <code>27D61492F208B0CF197E4B56067D8FE9</code> <code>F1222D0E3C3C04BE92189932A0AA3A2C</code> <code>910CBBD0C6645FB1972C807D66E012B5</code> <code>FA5EB4A4D8B60E3E59B5F03EB757C5CC</code> <code>4C54ED4E0AD5F07214D70DA97A62A740</code> <code>3B7A32E62B3732501F9B1359230BDF12</code> <code>0E4DCF18AB339EE8883E2D800355B0E5</code> <code>F351EAE23FD44B60F649CC293C0039D6</code> <code>73ABD9B0708AE9028230BED69DD51DA7</code> <code>5C1B8801F597324F3A7CB4683BD609B9</code> <code>BD40DE9D52E0868547C0A9D9F579B612</code><br> <code>8A62F14E</code></td>
<td><code>FE0001004B9393CBF0FC5C756A7B9BC4</code> <code>868E27C112ACE80FC11C35740D11D19D</code> <code>EDD7C9F139C9E14F3AD6AA4E6470B46A</code> <code>FF695C1CFC7488D929A91B812B514B4F</code> <code>155A79E159A0928C38F4FFDB3DD16F02</code> <code>F1A1CDFFA36F6A271D420EF6551EC8CD</code> <code>F352EEB6BB591429C33ACA97251D2ED3</code> <code>55785C0DFA7A99690D597620DD1FA752</code> <code>4871C7E83832E9D319C3090BD87573D3</code> <code>AD8463BDA039B7673FA84D9259E2A1EF</code> <code>DAF6A502FBCEDA94E1999E56DCA6D991</code> <code>24A90387F5FEF0065DC3E60E96446096</code> <code>79F27F7126FB171B4EC0456744A6851D</code> <code>FF36CBC036A994A54664412B386AB5FD</code> <code>67144A0EF3448C0A73346E943D65D1BB</code> <code>B9F2DDD6EBDD9926B6106F0AECC8645F</code><br> <code>435D3F43</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>C7B67966</code> (1719252679 in decimal)</td>
<td><code>51BA7966</code> (1719253585 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D
<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 = A54F266C33E710D2AE04BD6E09C07FD1AD4C8EABF98BD4E7F0A48BB3889E563ABF2CE4AE130E1C7BCAD117D743F4F7618B27E9922C8F23207AFFD4A4E1E1D9253CDBB6DEBEA5C674FE95FD55097B14276BC46C90FCCB8DEC0273CCC45BD5FA3B204E8CA52FCDCABC7810FDD4AEB4796F60876FDC4F82F1C08C8A54788440206B4D8638001A47F0BA57576DAA500B7954CA488F97E65C7A4F68B423357F7E1F55C8E5B10C130F074E68117313C62B31468F21C952B2DC519BB5C06CD5970C0EB4EC9F52984EF0E40854F3D0039AD8B33B17920F2F3423DC8CCD3D3076D6CA1DD135E5461A490C3FF437CA4EB537629205BF38A11C84255CFD05098500F15AA9CD</code></pre>
<pre><code>b = B54901B0FCE619B4BB06E10C4906114E305EA3B40CBABC779487869947285B69695F8D6FF849C770B56F994F79246B266EF92CB5D5508D1568903BDFB58B19D89C227B0A1A6150DE633CCB5441D59EFE6B331477C6290F2FCF9240FB664877D74AD202EF246776E9623464711FA4850EAC908C0FE569CE533B16302680059609B37BD6DFF5E6D633F55404D64D659A44BCA595B2194DBA462B19034640D081B45C5306FF1923339A5D6BBB1B34B6DCF452C26978967904F3F1D583E8441EEFC8055754B6A54A078C51D3BE2433807308D01152586356E13B2D0D9036FB6377DB94C3B9A1CDC6028CBD5C0571100F7D5C84F43A02519979FC43372F7D28A31729</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 = 2812EBAAD2502B9846CA086240815E5CDAAC50FD49CB4A1ACE8D15849913D414068A6EF361A19D94F8758A818F967CCEC13BF05A494EAA2291F8A928592060F0D73A84A29BB66EDD9F734BEEF6F750AD14E4BED67832CDC670022EC1B7C6984E0963CE8252CC73064B8BF1D407CAD64BDDABDC313ED3C349A45992386B9E87C46CDC5257D7E2935DF0F4B10E3A30159EAC7FE6AF6561DCD33AF6F733B2E3EF36CD00C35F907E19334A80954B08F330ACD9684A6561240A785A8C8774FE6078738DB8D6776D6CCAC2BA68EC519C6EBCC8C39ED5B9474B43E7F547320F57F27C33ADF296C48107E64847AEBACB8E69C76CE003C1D6D373DDE80389C79706E8A260</code></pre>
<pre><code>g_b = 2B66EF0EA54F1D950C0AE2DD63EED31AA21F82B5FB16ACF59DE34FC26B53B923FAA67B2FCBE5CB80F18C38CE163ECA2CB8952A59F6A7F2F3E71B8C6683A200F0E2936C1AEF59E932EA2C90EEB95051D17882BF814B8FEA7FFFB3AE993FCA9CC7684D2E9645AB246B5F62EF8CA2D6C98000663E48D47BF1BD2CEA15D3DBA8C8183903CB0CAE1E7DCD59BE34854446267748F91D84BEDA82689B00831B58ED63BBA326BA07F6873CEA5327001D83FFB3DD0C095959EAC002C70715F088B650F83CC1671295E51D4963EF41FC725F3FCE571E897B7E2C8B04125945985C34F5046960CFA6B38C641EEA1E3C3747ABB583B904D9EDD1BC8A92580C8BD7D6FCC2225E</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 FF 94 B2 49 02 3B A8 8D A0 2F D6 95
0010 | 79 D7 C4 03 C7 A1 D4 5C 25 AF 92 79 BD 9C 96 D7
0020 | 14 48 D3 D3 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 28 12 EB AA D2 50 2B 98 46 CA 08 62 40 81 5E 5C
0040 | DA AC 50 FD 49 CB 4A 1A CE 8D 15 84 99 13 D4 14
0050 | 06 8A 6E F3 61 A1 9D 94 F8 75 8A 81 8F 96 7C CE
0060 | C1 3B F0 5A 49 4E AA 22 91 F8 A9 28 59 20 60 F0
0070 | D7 3A 84 A2 9B B6 6E DD 9F 73 4B EE F6 F7 50 AD
0080 | 14 E4 BE D6 78 32 CD C6 70 02 2E C1 B7 C6 98 4E
0090 | 09 63 CE 82 52 CC 73 06 4B 8B F1 D4 07 CA D6 4B
00A0 | DD AB DC 31 3E D3 C3 49 A4 59 92 38 6B 9E 87 C4
00B0 | 6C DC 52 57 D7 E2 93 5D F0 F4 B1 0E 3A 30 15 9E
00C0 | AC 7F E6 AF 65 61 DC D3 3A F6 F7 33 B2 E3 EF 36
00D0 | CD 00 C3 5F 90 7E 19 33 4A 80 95 4B 08 F3 30 AC
00E0 | D9 68 4A 65 61 24 0A 78 5A 8C 87 74 FE 60 78 73
00F0 | 8D B8 D6 77 6D 6C CA C2 BA 68 EC 51 9C 6E BC C8
0100 | C3 9E D5 B9 47 4B 43 E7 F5 47 32 0F 57 F2 7C 33
0110 | AD F2 96 C4 81 07 E6 48 47 AE BA CB 8E 69 C7 6C
0120 | E0 03 C1 D6 D3 73 DD E8 03 89 C7 97 06 E8 A2 60</code></pre>
<pre><code>0000 | 54 B6 43 66 89 66 1B 73 7A 31 36 75 4D C8 B0 EE
0010 | C3 20 B4 5A 5B 48 21 9D 38 80 3F AC A0 A5 21 5A
0020 | 41 BD 8B 78 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 2B 66 EF 0E A5 4F 1D 95 0C 0A E2 DD 63 EE D3 1A
0040 | A2 1F 82 B5 FB 16 AC F5 9D E3 4F C2 6B 53 B9 23
0050 | FA A6 7B 2F CB E5 CB 80 F1 8C 38 CE 16 3E CA 2C
0060 | B8 95 2A 59 F6 A7 F2 F3 E7 1B 8C 66 83 A2 00 F0
0070 | E2 93 6C 1A EF 59 E9 32 EA 2C 90 EE B9 50 51 D1
0080 | 78 82 BF 81 4B 8F EA 7F FF B3 AE 99 3F CA 9C C7
0090 | 68 4D 2E 96 45 AB 24 6B 5F 62 EF 8C A2 D6 C9 80
00A0 | 00 66 3E 48 D4 7B F1 BD 2C EA 15 D3 DB A8 C8 18
00B0 | 39 03 CB 0C AE 1E 7D CD 59 BE 34 85 44 46 26 77
00C0 | 48 F9 1D 84 BE DA 82 68 9B 00 83 1B 58 ED 63 BB
00D0 | A3 26 BA 07 F6 87 3C EA 53 27 00 1D 83 FF B3 DD
00E0 | 0C 09 59 59 EA C0 02 C7 07 15 F0 88 B6 50 F8 3C
00F0 | C1 67 12 95 E5 1D 49 63 EF 41 FC 72 5F 3F CE 57
0100 | 1E 89 7B 7E 2C 8B 04 12 59 45 98 5C 34 F5 04 69
0110 | 60 CF A6 B3 8C 64 1E EA 1E 3C 37 47 AB B5 83 B9
0120 | 04 D9 ED D1 BC 8A 92 58 0C 8B D7 D6 FC C2 22 5E</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 = BA0D89B5FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>C7A1D45C25AF9279BD9C96D71448D3D3</code></td>
<td><code>5B48219D38803FACA0A5215A41BD8B78</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001002812EBAAD2502B9846CA0862</code> <code>40815E5CDAAC50FD49CB4A1ACE8D1584</code> <code>9913D414068A6EF361A19D94F8758A81</code> <code>8F967CCEC13BF05A494EAA2291F8A928</code> <code>592060F0D73A84A29BB66EDD9F734BEE</code> <code>F6F750AD14E4BED67832CDC670022EC1</code> <code>B7C6984E0963CE8252CC73064B8BF1D4</code> <code>07CAD64BDDABDC313ED3C349A4599238</code> <code>6B9E87C46CDC5257D7E2935DF0F4B10E</code> <code>3A30159EAC7FE6AF6561DCD33AF6F733</code> <code>B2E3EF36CD00C35F907E19334A80954B</code> <code>08F330ACD9684A6561240A785A8C8774</code> <code>FE6078738DB8D6776D6CCAC2BA68EC51</code> <code>9C6EBCC8C39ED5B9474B43E7F547320F</code> <code>57F27C33ADF296C48107E64847AEBACB</code> <code>8E69C76CE003C1D6D373DDE80389C797</code><br> <code>06E8A260</code></td>
<td><code>FE0001002B66EF0EA54F1D950C0AE2DD</code> <code>63EED31AA21F82B5FB16ACF59DE34FC2</code> <code>6B53B923FAA67B2FCBE5CB80F18C38CE</code> <code>163ECA2CB8952A59F6A7F2F3E71B8C66</code> <code>83A200F0E2936C1AEF59E932EA2C90EE</code> <code>B95051D17882BF814B8FEA7FFFB3AE99</code> <code>3FCA9CC7684D2E9645AB246B5F62EF8C</code> <code>A2D6C98000663E48D47BF1BD2CEA15D3</code> <code>DBA8C8183903CB0CAE1E7DCD59BE3485</code> <code>4446267748F91D84BEDA82689B00831B</code> <code>58ED63BBA326BA07F6873CEA5327001D</code> <code>83FFB3DD0C095959EAC002C70715F088</code> <code>B650F83CC1671295E51D4963EF41FC72</code> <code>5F3FCE571E897B7E2C8B04125945985C</code> <code>34F5046960CFA6B38C641EEA1E3C3747</code> <code>ABB583B904D9EDD1BC8A92580C8BD7D6</code><br> <code>FCC2225E</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 = BA0D89B5FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D
<!-- 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 = 54B64366FF94B249023BA88DA02FD69579D7C403C7A1D45C25AF9279BD9C96D71448D3D30000000000000000FE0001002812EBAAD2502B9846CA086240815E5CDAAC50FD49CB4A1ACE8D15849913D414068A6EF361A19D94F8758A818F967CCEC13BF05A494EAA2291F8A928592060F0D73A84A29BB66EDD9F734BEEF6F750AD14E4BED67832CDC670022EC1B7C6984E0963CE8252CC73064B8BF1D407CAD64BDDABDC313ED3C349A45992386B9E87C46CDC5257D7E2935DF0F4B10E3A30159EAC7FE6AF6561DCD33AF6F733B2E3EF36CD00C35F907E19334A80954B08F330ACD9684A6561240A785A8C8774FE6078738DB8D6776D6CCAC2BA68EC519C6EBCC8C39ED5B9474B43E7F547320F57F27C33ADF296C48107E64847AEBACB8E69C76CE003C1D6D373DDE80389C79706E8A260
padding = 0FA99B2C4A0BCBC2F585926D
tmp_aes_key = B92981189223E79306ED28A79803166CB9955A23AB1278C4F2C911449BCBA10B
tmp_aes_iv = 72CF3E363A1C6658B900F9427A230DC6EA595327438D5C28EB9287336BC160F4</code></pre>
<pre><code>data = 54B6436689661B737A3136754DC8B0EEC320B45A5B48219D38803FACA0A5215A41BD8B780000000000000000FE0001002B66EF0EA54F1D950C0AE2DD63EED31AA21F82B5FB16ACF59DE34FC26B53B923FAA67B2FCBE5CB80F18C38CE163ECA2CB8952A59F6A7F2F3E71B8C6683A200F0E2936C1AEF59E932EA2C90EEB95051D17882BF814B8FEA7FFFB3AE993FCA9CC7684D2E9645AB246B5F62EF8CA2D6C98000663E48D47BF1BD2CEA15D3DBA8C8183903CB0CAE1E7DCD59BE34854446267748F91D84BEDA82689B00831B58ED63BBA326BA07F6873CEA5327001D83FFB3DD0C095959EAC002C70715F088B650F83CC1671295E51D4963EF41FC725F3FCE571E897B7E2C8B04125945985C34F5046960CFA6B38C641EEA1E3C3747ABB583B904D9EDD1BC8A92580C8BD7D6FCC2225E
padding = 3F091096EE25625890DF6092
tmp_aes_key = D95D6D1F73B86C9F2FEE57031834B871E2EB8BB8B07F7DBAD277D94A023BEA0A
tmp_aes_iv = 1FF06E972F99F6F583AD0491DCDF21A68218A8B019B3AFB930D4038E0AF0B6F6</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 = 92F33178E8FD0B2503164E4958B30642017D6B3ED097E631790E1A91918986FDC7EEA2375114CE417AFF2BBD1508949A9C516982DA4262E6B3020961D6D2348B1F31B0C04742D8360C14E17289CCE08EC6CDE27BDAB946958AF0CA145431094F6560DDC3C05C03135E11EBFCA46D9D4C925B52905C9DBB6E8331B2EF04A3044BF0E304BA153269246E59C769F047C25D87D3EF13FA9F404F0647B5C3B2D815318C4C07BCBB40A2144DEF9498E28B797EE84F2EA06D261E6294826D16343903D64DE50041EA0C806C120D5F3C9DF63276AD2BB80F96CF96A0B42924F6A0BCF61B2BD107197F253A31E7154C5E15301015A407AB433910F5F6CBC746B620577CA92F1A77B49B17F47A262CE97EBBFDC367E6015FB32AA0D51C21A1640DCA7A3D75443D5D7706FCE4BF755799E5FC1982E7A05D97E594529E31CBCA24DC32B98BBFDB3C6B2C5D87C3C7D5E90423FDAAE254</code></pre>
<pre><code>encrypted_data = E4FF52003387B3D3C84A357EB093C476F509BFCF55E73C65E1E050B2F7E9DAD7271441A678527E6CBDE425677340054A00A97FDA4A270AF2F2ADCD6C58A5A3A3CEDD72EE325A5858783D32F90F3D061B78BAB8306AF8C65161EBA2093501CFF608E152ABB82B28B4AF717437337B66BD55AE96F8CCE264A48DFC30DC470615A6C0391BD29E8A7EC2BCE06A7F0D67EF64DCC798BCA89DC549BDE4B0B38CD444BA2FE9332CBE77AC0264BBF35D3CA98C0355C10167BCB811A63E4038BFDD02848D7AB35789E5A6AD0F2FECF3B94A36D0C2FAE6EF5542F3FD2B08DFFDA803912628E7CDE831CA61BEF1C2F6948D1DD4741CAF19466222C975A034B7E2A283E5631B47B729983585C3322038115E6B23E0D0967676A1DCB0006D038460BEAF8A903176A583AB626474EE31CAB38C589F5FCF4171C2A81E5CDCA93C4F8518AA681F852AB825AC1BED8D9F7C778E9A5AEA167F</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 A0 47 0A 00 C7 B6 79 66
0010 | 78 01 00 00 1F 5F 04 F5 FF 94 B2 49 02 3B A8 8D
0020 | A0 2F D6 95 79 D7 C4 03 C7 A1 D4 5C 25 AF 92 79
0030 | BD 9C 96 D7 14 48 D3 D3 FE 50 01 00 92 F3 31 78
0040 | E8 FD 0B 25 03 16 4E 49 58 B3 06 42 01 7D 6B 3E
0050 | D0 97 E6 31 79 0E 1A 91 91 89 86 FD C7 EE A2 37
0060 | 51 14 CE 41 7A FF 2B BD 15 08 94 9A 9C 51 69 82
0070 | DA 42 62 E6 B3 02 09 61 D6 D2 34 8B 1F 31 B0 C0
0080 | 47 42 D8 36 0C 14 E1 72 89 CC E0 8E C6 CD E2 7B
0090 | DA B9 46 95 8A F0 CA 14 54 31 09 4F 65 60 DD C3
00A0 | C0 5C 03 13 5E 11 EB FC A4 6D 9D 4C 92 5B 52 90
00B0 | 5C 9D BB 6E 83 31 B2 EF 04 A3 04 4B F0 E3 04 BA
00C0 | 15 32 69 24 6E 59 C7 69 F0 47 C2 5D 87 D3 EF 13
00D0 | FA 9F 40 4F 06 47 B5 C3 B2 D8 15 31 8C 4C 07 BC
00E0 | BB 40 A2 14 4D EF 94 98 E2 8B 79 7E E8 4F 2E A0
00F0 | 6D 26 1E 62 94 82 6D 16 34 39 03 D6 4D E5 00 41
0100 | EA 0C 80 6C 12 0D 5F 3C 9D F6 32 76 AD 2B B8 0F
0110 | 96 CF 96 A0 B4 29 24 F6 A0 BC F6 1B 2B D1 07 19
0120 | 7F 25 3A 31 E7 15 4C 5E 15 30 10 15 A4 07 AB 43
0130 | 39 10 F5 F6 CB C7 46 B6 20 57 7C A9 2F 1A 77 B4
0140 | 9B 17 F4 7A 26 2C E9 7E BB FD C3 67 E6 01 5F B3
0150 | 2A A0 D5 1C 21 A1 64 0D CA 7A 3D 75 44 3D 5D 77
0160 | 06 FC E4 BF 75 57 99 E5 FC 19 82 E7 A0 5D 97 E5
0170 | 94 52 9E 31 CB CA 24 DC 32 B9 8B BF DB 3C 6B 2C
0180 | 5D 87 C3 C7 D5 E9 04 23 FD AA E2 54</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 B8 10 0D 00 51 BA 79 66
0010 | 78 01 00 00 1F 5F 04 F5 89 66 1B 73 7A 31 36 75
0020 | 4D C8 B0 EE C3 20 B4 5A 5B 48 21 9D 38 80 3F AC
0030 | A0 A5 21 5A 41 BD 8B 78 FE 50 01 00 E4 FF 52 00
0040 | 33 87 B3 D3 C8 4A 35 7E B0 93 C4 76 F5 09 BF CF
0050 | 55 E7 3C 65 E1 E0 50 B2 F7 E9 DA D7 27 14 41 A6
0060 | 78 52 7E 6C BD E4 25 67 73 40 05 4A 00 A9 7F DA
0070 | 4A 27 0A F2 F2 AD CD 6C 58 A5 A3 A3 CE DD 72 EE
0080 | 32 5A 58 58 78 3D 32 F9 0F 3D 06 1B 78 BA B8 30
0090 | 6A F8 C6 51 61 EB A2 09 35 01 CF F6 08 E1 52 AB
00A0 | B8 2B 28 B4 AF 71 74 37 33 7B 66 BD 55 AE 96 F8
00B0 | CC E2 64 A4 8D FC 30 DC 47 06 15 A6 C0 39 1B D2
00C0 | 9E 8A 7E C2 BC E0 6A 7F 0D 67 EF 64 DC C7 98 BC
00D0 | A8 9D C5 49 BD E4 B0 B3 8C D4 44 BA 2F E9 33 2C
00E0 | BE 77 AC 02 64 BB F3 5D 3C A9 8C 03 55 C1 01 67
00F0 | BC B8 11 A6 3E 40 38 BF DD 02 84 8D 7A B3 57 89
0100 | E5 A6 AD 0F 2F EC F3 B9 4A 36 D0 C2 FA E6 EF 55
0110 | 42 F3 FD 2B 08 DF FD A8 03 91 26 28 E7 CD E8 31
0120 | CA 61 BE F1 C2 F6 94 8D 1D D4 74 1C AF 19 46 62
0130 | 22 C9 75 A0 34 B7 E2 A2 83 E5 63 1B 47 B7 29 98
0140 | 35 85 C3 32 20 38 11 5E 6B 23 E0 D0 96 76 76 A1
0150 | DC B0 00 6D 03 84 60 BE AF 8A 90 31 76 A5 83 AB
0160 | 62 64 74 EE 31 CA B3 8C 58 9F 5F CF 41 71 C2 A8
0170 | 1E 5C DC A9 3C 4F 85 18 AA 68 1F 85 2A B8 25 AC
0180 | 1B ED 8D 9F 7C 77 8E 9A 5A EA 16 7F</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>A0470A00C7B67966</code></td>
<td><code>B8100D0051BA7966</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>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>C7A1D45C25AF9279BD9C96D71448D3D3</code></td>
<td><code>5B48219D38803FACA0A5215A41BD8B78</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE50010092F33178E8FD0B2503164E49</code> <code>58B30642017D6B3ED097E631790E1A91</code> <code>918986FDC7EEA2375114CE417AFF2BBD</code> <code>1508949A9C516982DA4262E6B3020961</code> <code>D6D2348B1F31B0C04742D8360C14E172</code> <code>89CCE08EC6CDE27BDAB946958AF0CA14</code> <code>5431094F6560DDC3C05C03135E11EBFC</code> <code>A46D9D4C925B52905C9DBB6E8331B2EF</code> <code>04A3044BF0E304BA153269246E59C769</code> <code>F047C25D87D3EF13FA9F404F0647B5C3</code> <code>B2D815318C4C07BCBB40A2144DEF9498</code> <code>E28B797EE84F2EA06D261E6294826D16</code> <code>343903D64DE50041EA0C806C120D5F3C</code> <code>9DF63276AD2BB80F96CF96A0B42924F6</code> <code>A0BCF61B2BD107197F253A31E7154C5E</code> <code>15301015A407AB433910F5F6CBC746B6</code> <code>20577CA92F1A77B49B17F47A262CE97E</code> <code>BBFDC367E6015FB32AA0D51C21A1640D</code> <code>CA7A3D75443D5D7706FCE4BF755799E5</code> <code>FC1982E7A05D97E594529E31CBCA24DC</code> <code>32B98BBFDB3C6B2C5D87C3C7D5E90423</code><br> <code>FDAAE254</code></td>
<td><code>FE500100E4FF52003387B3D3C84A357E</code> <code>B093C476F509BFCF55E73C65E1E050B2</code> <code>F7E9DAD7271441A678527E6CBDE42567</code> <code>7340054A00A97FDA4A270AF2F2ADCD6C</code> <code>58A5A3A3CEDD72EE325A5858783D32F9</code> <code>0F3D061B78BAB8306AF8C65161EBA209</code> <code>3501CFF608E152ABB82B28B4AF717437</code> <code>337B66BD55AE96F8CCE264A48DFC30DC</code> <code>470615A6C0391BD29E8A7EC2BCE06A7F</code> <code>0D67EF64DCC798BCA89DC549BDE4B0B3</code> <code>8CD444BA2FE9332CBE77AC0264BBF35D</code> <code>3CA98C0355C10167BCB811A63E4038BF</code> <code>DD02848D7AB35789E5A6AD0F2FECF3B9</code> <code>4A36D0C2FAE6EF5542F3FD2B08DFFDA8</code> <code>03912628E7CDE831CA61BEF1C2F6948D</code> <code>1DD4741CAF19466222C975A034B7E2A2</code> <code>83E5631B47B729983585C3322038115E</code> <code>6B23E0D0967676A1DCB0006D038460BE</code> <code>AF8A903176A583AB626474EE31CAB38C</code> <code>589F5FCF4171C2A81E5CDCA93C4F8518</code> <code>AA681F852AB825AC1BED8D9F7C778E9A</code><br> <code>5AEA167F</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 = 8904B87CFFDED98818B2927ABDF5869D8CA8E3F6DBE8B33CAB82916448C5FADB045CD67CDAFF9B9FF02E0516F9AA76A250AB2ACCDDB0EB7ACC6524CB9775BA0CD241F367CD15F914778F0B8CF31DB96A02665047C1CB12D256391C865753B4F4DF36F66F0CAF67F9055D926C8081AE913CE6DC83769525887D28314D63A9F299819F2E7169AE7FD6F0A54D87F7CC75718FC12A7648C8C8AD57B65F0782AF30A506DF4A7659A862CE0F488D9F3949D1389242861C0854E58CE790BAC3DDE9CA070FB6542069A6B5430747A16D28A14512A8FF07B4F7B3D7D35EDFE62EBC58E70C02355B9AEA42D35B85C89745F4DA13D45F97FCBB27FADAB03E3175F300E19530</code></pre>
<pre><code>auth_key = 924E77E092B9797DF9E377211291A664D8C63B494DCFEF1C505C880E42D71611BE8C473B4658A93CAF81867E3F4A9D194960D4EC790D1731088804BEA1C934CB3875ACF904286BEDF850E24DD1DB5F374D9DB720484DE04324A8C7B920AD9396E3964F7C4C580EC94BAF5A111099577595C0D818699CBF7629E186768FA204D9DB57B56B1FBAF03D48F9F79BEEDDB742051363E3A8AA7F22B2C87F3C6726F38C855F87BDA2849E89138B4D73A0B86F9F50CA279959B82C40ABC436BB1286337D61D3EA0C126F185AD465CF9368EE30AB112A09DAAF9996AB56D2CAC8091DFA7EDCF8740BC4B3AD2E2E595B29091670ABBF233B882C7C5B5F18CA4DE9B19D2CB4</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 E0 A2 13 C8 B6 79 66
0010 | 64 00 00 00 34 F7 CB 3B FF 94 B2 49 02 3B A8 8D
0020 | A0 2F D6 95 79 D7 C4 03 C7 A1 D4 5C 25 AF 92 79
0030 | BD 9C 96 D7 14 48 D3 D3 69 A3 12 8D CE F2 30 8A
0040 | 1F 7F 3B 8A 3D 5C 7E 37</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D4 97 24 52 BA 79 66
0010 | 80 00 00 00 34 F7 CB 3B 89 66 1B 73 7A 31 36 75
0020 | 4D C8 B0 EE C3 20 B4 5A 5B 48 21 9D 38 80 3F AC
0030 | A0 A5 21 5A 41 BD 8B 78 F0 7C 80 6F 92 42 0A CC
0040 | C8 F7 42 B9 41 39 6E EA</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01E0A213C8B67966</code></td>
<td><code>01D4972452BA7966</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>64000000</code> (100 in decimal)</td>
<td><code>80000000</code> (128 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>FF94B249023BA88DA02FD69579D7C403</code></td>
<td><code>89661B737A3136754DC8B0EEC320B45A</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>C7A1D45C25AF9279BD9C96D71448D3D3</code></td>
<td><code>5B48219D38803FACA0A5215A41BD8B78</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>69A3128DCEF2308A1F7F3B8A3D5C7E37</code></td>
<td><code>F07C806F92420ACCC8F742B941396EEA</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>