Update content of files

This commit is contained in:
GitHub Action 2023-11-15 21:18:41 +00:00
parent b45c1a360b
commit 8067fc8949
6 changed files with 233 additions and 212 deletions

View file

@ -207,14 +207,33 @@ After obtaining the ID token, call <a href="/method/account.verifyEmail">account
</ul> </ul>
<p>If the user cannot access their email address, an email reset may be requested using <a href="/method/auth.resetLoginEmail">auth.resetLoginEmail</a>. </p> <p>If the user cannot access their email address, an email reset may be requested using <a href="/method/auth.resetLoginEmail">auth.resetLoginEmail</a>. </p>
<p>To change the login email after login, pass <a href="/constructor/emailVerifyPurposeLoginChange">emailVerifyPurposeLoginChange</a> as <code>purpose</code>, following the exact same Google ID/Apple ID/email code login flow as above: on success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return an <a href="/constructor/account.emailVerified">account.emailVerified</a> constructor.</p> <p>To change the login email after login, pass <a href="/constructor/emailVerifyPurposeLoginChange">emailVerifyPurposeLoginChange</a> as <code>purpose</code>, following the exact same Google ID/Apple ID/email code login flow as above: on success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return an <a href="/constructor/account.emailVerified">account.emailVerified</a> constructor.</p>
<h3><a class="anchor" href="#sign-insign-up" id="sign-insign-up" name="sign-insign-up"><i class="anchor-icon"></i></a>Sign in/sign up</h3> <h3><a class="anchor" href="#sign-in-sign-up" id="sign-in-sign-up" name="sign-in-sign-up"><i class="anchor-icon"></i></a>Sign in/sign up</h3>
<p>When user enters verification code, the <a href="/method/auth.signIn">auth.signIn</a> method must be used to validate it and possibly sign user in.</p> <p>When user enters verification code, the <a href="/method/auth.signIn">auth.signIn</a> method must be used to validate it and possibly sign user in.</p>
<p>If the code was entered correctly, but the method returns <a href="/constructor/auth.authorizationSignUpRequired">auth.authorizationSignUpRequired</a>, it means that account with this phone number doesn't exist yet: user needs to provide basic information, accept terms of service and then the new user registration method (<a href="/method/auth.signUp">auth.signUp</a>) must be invoked.</p> <p>If the code was entered correctly, but the method returns <a href="/constructor/auth.authorizationSignUpRequired">auth.authorizationSignUpRequired</a>, it means that account with this phone number doesn't exist yet: user needs to provide basic information, accept terms of service and then the new user registration method (<a href="/method/auth.signUp">auth.signUp</a>) must be invoked.</p>
<h3><a class="anchor" href="#2fa" id="2fa" name="2fa"><i class="anchor-icon"></i></a>2FA</h3> <h3><a class="anchor" href="#2fa" id="2fa" name="2fa"><i class="anchor-icon"></i></a>2FA</h3>
<p>When trying to sign in using <a href="/method/auth.signIn">auth.signIn</a>, an <a href="/method/auth.signIn#possible-errors">error 400 SESSION_PASSWORD_NEEDED</a> may be returned, if the user has two-factor authentication enabled. <p>When trying to sign in using <a href="/method/auth.signIn">auth.signIn</a>, an <a href="/method/auth.signIn#possible-errors">error 400 SESSION_PASSWORD_NEEDED</a> may be returned, if the user has two-factor authentication enabled.
In this case, instructions for <a href="/api/srp">SRP 2FA authentication</a> must be followed.</p> In this case, instructions for <a href="/api/srp">SRP 2FA authentication</a> must be followed.</p>
<p>To set up two-factor authorization on an already authorized account, follow the <a href="/api/srp">SRP 2FA authentication docs</a>.</p> <p>To set up two-factor authorization on an already authorized account, follow the <a href="/api/srp">SRP 2FA authentication docs</a>.</p>
<h4><a class="anchor" href="#test-accounts" id="test-accounts" name="test-accounts"><i class="anchor-icon"></i></a>Test Accounts</h4> <h3><a class="anchor" href="#confirming-login" id="confirming-login" name="confirming-login"><i class="anchor-icon"></i></a>Confirming login</h3>
<pre><code><a href='/constructor/authorization'>authorization</a>#ad01d61d flags:<a href='/type/%23'>#</a> current:flags.0?<a href='/constructor/true'>true</a> official_app:flags.1?<a href='/constructor/true'>true</a> password_pending:flags.2?<a href='/constructor/true'>true</a> encrypted_requests_disabled:flags.3?<a href='/constructor/true'>true</a> call_requests_disabled:flags.4?<a href='/constructor/true'>true</a> unconfirmed:flags.5?<a href='/constructor/true'>true</a> hash:<a href='/type/long'>long</a> device_model:<a href='/type/string'>string</a> platform:<a href='/type/string'>string</a> system_version:<a href='/type/string'>string</a> api_id:<a href='/type/int'>int</a> app_name:<a href='/type/string'>string</a> app_version:<a href='/type/string'>string</a> date_created:<a href='/type/int'>int</a> date_active:<a href='/type/int'>int</a> ip:<a href='/type/string'>string</a> country:<a href='/type/string'>string</a> region:<a href='/type/string'>string</a> = <a href='/type/Authorization'>Authorization</a>;
<a href='/constructor/account.authorizations'>account.authorizations</a>#4bff8ea0 authorization_ttl_days:<a href='/type/int'>int</a> authorizations:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Authorization'>Authorization</a>&gt; = <a href='/type/account.Authorizations'>account.Authorizations</a>;
<a href='/constructor/updateNewAuthorization'>updateNewAuthorization</a>#8951abef flags:<a href='/type/%23'>#</a> unconfirmed:flags.0?<a href='/constructor/true'>true</a> hash:<a href='/type/long'>long</a> date:flags.0?<a href='/type/int'>int</a> device:flags.0?<a href='/type/string'>string</a> location:flags.0?<a href='/type/string'>string</a> = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/account.getAuthorizations'>account.getAuthorizations</a>#e320c158 = <a href='/type/account.Authorizations'>account.Authorizations</a>;
<a href='/method/account.changeAuthorizationSettings'>account.changeAuthorizationSettings</a>#40f48462 flags:<a href='/type/%23'>#</a> confirmed:flags.3?<a href='/constructor/true'>true</a> hash:<a href='/type/long'>long</a> encrypted_requests_disabled:flags.0?<a href='/type/Bool'>Bool</a> call_requests_disabled:flags.1?<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/account.resetAuthorization'>account.resetAuthorization</a>#df77f3bc hash:<a href='/type/long'>long</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>When logging in, other logged-in sessions will receive an <a href="/constructor/updateNewAuthorization">updateNewAuthorization</a> update.<br>
If the <code>unconfirmed</code> flag is set, clients should display a notification, asking the user if they recognize the session. </p>
<p>If the user clicks on the Yes button, invoke <a href="/method/account.changeAuthorizationSettings">account.changeAuthorizationSettings</a> with the new session's <code>hash</code> and the <code>confirmed</code> flag set, confirming the specified session. </p>
<p>If the user clicks on the No button, invoke <a href="/method/account.resetAuthorization">account.resetAuthorization</a> with the new session's <code>hash</code>, logging out the specified session. </p>
<p>If no action is taken by the user, the session will be autoconfirmed <code>authorization_autoconfirm_period</code> seconds after login (see the associated <a href="/api/config#authorization-autoconfirm-period">client configuration parameter »</a>). </p>
<h3><a class="anchor" href="#test-accounts" id="test-accounts" name="test-accounts"><i class="anchor-icon"></i></a>Test Accounts</h3>
<p>Each phone number is limited to only a certain amount of logins per day (e.g. 5, but this is subject to change) after which the API will return a FLOOD error until the next day. This might not be enough for testing the implementation of User Authorization flows in client applications.</p> <p>Each phone number is limited to only a certain amount of logins per day (e.g. 5, but this is subject to change) after which the API will return a FLOOD error until the next day. This might not be enough for testing the implementation of User Authorization flows in client applications.</p>
<p>There are several reserved phone number prefixes for testing that your application handles redirects between DCs, sign up, sign in and 2FA flows correctly. These numbers are only available on <strong>Test DCs</strong> (their IP addresses for TCP transport are available in <a href="https://my.telegram.org/apps">API development tools</a> panel after <a href="https://core.telegram.org/api/obtaining_api_id#obtaining-api-id">api_id was obtained</a>, <a href="https://core.telegram.org/mtproto/transports#uri-format">URI format</a> for HTTPS/WebSocket transport).</p> <p>There are several reserved phone number prefixes for testing that your application handles redirects between DCs, sign up, sign in and 2FA flows correctly. These numbers are only available on <strong>Test DCs</strong> (their IP addresses for TCP transport are available in <a href="https://my.telegram.org/apps">API development tools</a> panel after <a href="https://core.telegram.org/api/obtaining_api_id#obtaining-api-id">api_id was obtained</a>, <a href="https://core.telegram.org/mtproto/transports#uri-format">URI format</a> for HTTPS/WebSocket transport).</p>
<p>If you wish to emulate an application of a user associated with DC number X, it is sufficient to specify the phone number as <code>99966XYYYY</code>, where YYYY are random numbers, when registering the user. A user like this would always get XXXXX as the login confirmation code (the DC number, repeated five times). Note that the value of X must be in the range of 1-3 because there are only 3 Test DCs. When the flood limit is reached for any particular test number, just choose another number (changing the YYYY random part).</p> <p>If you wish to emulate an application of a user associated with DC number X, it is sufficient to specify the phone number as <code>99966XYYYY</code>, where YYYY are random numbers, when registering the user. A user like this would always get XXXXX as the login confirmation code (the DC number, repeated five times). Note that the value of X must be in the range of 1-3 because there are only 3 Test DCs. When the flood limit is reached for any particular test number, just choose another number (changing the YYYY random part).</p>

View file

@ -460,12 +460,14 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<h4><a class="anchor" href="#large-queue-max-active-operations-count" id="large-queue-max-active-operations-count" name="large-queue-max-active-operations-count"><i class="anchor-icon"></i></a><code>large_queue_max_active_operations_count</code></h4> <h4><a class="anchor" href="#large-queue-max-active-operations-count" id="large-queue-max-active-operations-count" name="large-queue-max-active-operations-count"><i class="anchor-icon"></i></a><code>large_queue_max_active_operations_count</code></h4>
<p>A soft limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files bigger than 20MB. (integer)</p> <p>A soft limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files bigger than 20MB. (integer)</p>
<h4><a class="anchor" href="#authorization-autoconfirm-period" id="authorization-autoconfirm-period" name="authorization-autoconfirm-period"><i class="anchor-icon"></i></a><code>authorization_autoconfirm_period</code></h4> <h4><a class="anchor" href="#authorization-autoconfirm-period" id="authorization-autoconfirm-period" name="authorization-autoconfirm-period"><i class="anchor-icon"></i></a><code>authorization_autoconfirm_period</code></h4>
<p>An <a href="/api/auth#confirming-login">unconfirmed session »</a> will be autoconfirmed this many seconds after login. (integer)</p>
<h4><a class="anchor" href="#story-viewers-expire-period" id="story-viewers-expire-period" name="story-viewers-expire-period"><i class="anchor-icon"></i></a><code>story_viewers_expire_period</code></h4> <h4><a class="anchor" href="#story-viewers-expire-period" id="story-viewers-expire-period" name="story-viewers-expire-period"><i class="anchor-icon"></i></a><code>story_viewers_expire_period</code></h4>
<p>The exact list of users that viewed the story will be hidden from the poster this many seconds after the story expires. (integer)</p> <p>The exact list of users that viewed the story will be hidden from the poster this many seconds after the story expires. (integer)</p>
<p>This limit applies <strong>only</strong> to non-<a href="/api/premium">Premium</a> users, <a href="/api/premium">Premium</a> users can <strong>always</strong> access the viewer list.</p> <p>This limit applies <strong>only</strong> to non-<a href="/api/premium">Premium</a> users, <a href="/api/premium">Premium</a> users can <strong>always</strong> access the viewer list.</p>
<h4><a class="anchor" href="#story-expiring-limit-default" id="story-expiring-limit-default" name="story-expiring-limit-default"><i class="anchor-icon"></i></a><code>story_expiring_limit_default</code></h4> <h4><a class="anchor" href="#story-expiring-limit-default" id="story-expiring-limit-default" name="story-expiring-limit-default"><i class="anchor-icon"></i></a><code>story_expiring_limit_default</code></h4>
<p>The maximum number of active stories </p> <p>The maximum number of active <a href="/api/stories">stories</a> for non-<a href="/api/premium">Premium</a> users (integer).</p>
<h4><a class="anchor" href="#story-expiring-limit-premium" id="story-expiring-limit-premium" name="story-expiring-limit-premium"><i class="anchor-icon"></i></a><code>story_expiring_limit_premium</code></h4> <h4><a class="anchor" href="#story-expiring-limit-premium" id="story-expiring-limit-premium" name="story-expiring-limit-premium"><i class="anchor-icon"></i></a><code>story_expiring_limit_premium</code></h4>
<p>The maximum number of active <a href="/api/stories">stories</a> for <a href="/api/premium">Premium</a> users (integer).</p>
<h4><a class="anchor" href="#story-caption-length-limit-premium" id="story-caption-length-limit-premium" name="story-caption-length-limit-premium"><i class="anchor-icon"></i></a><code>story_caption_length_limit_premium</code></h4> <h4><a class="anchor" href="#story-caption-length-limit-premium" id="story-caption-length-limit-premium" name="story-caption-length-limit-premium"><i class="anchor-icon"></i></a><code>story_caption_length_limit_premium</code></h4>
<p>The maximum UTF-8 length of story captions for <a href="/api/premium">Premium</a> users. (integer)</p> <p>The maximum UTF-8 length of story captions for <a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#story-caption-length-limit-default" id="story-caption-length-limit-default" name="story-caption-length-limit-default"><i class="anchor-icon"></i></a><code>story_caption_length_limit_default</code></h4> <h4><a class="anchor" href="#story-caption-length-limit-default" id="story-caption-length-limit-default" name="story-caption-length-limit-default"><i class="anchor-icon"></i></a><code>story_caption_length_limit_default</code></h4>

View file

@ -1789,7 +1789,7 @@ Also, discussion group admins can now <a href="/api/discussion#requiring-users-t
<li>Added <a href="/method/messages.saveDefaultSendAs">messages.saveDefaultSendAs</a> - Change the default peer that should be used when sending messages to a specific group</li> <li>Added <a href="/method/messages.saveDefaultSendAs">messages.saveDefaultSendAs</a> - Change the default peer that should be used when sending messages to a specific group</li>
<li>Added <a href="/method/channels.getSendAs">channels.getSendAs</a> - Obtains a list of peers that can be used to send messages in a specific group</li> <li>Added <a href="/method/channels.getSendAs">channels.getSendAs</a> - Obtains a list of peers that can be used to send messages in a specific group</li>
<li>Added <a href="/method/account.setAuthorizationTTL">account.setAuthorizationTTL</a> - Set time-to-live of current session</li> <li>Added <a href="/method/account.setAuthorizationTTL">account.setAuthorizationTTL</a> - Set time-to-live of current session</li>
<li>Added <a href="/method/account.changeAuthorizationSettings">account.changeAuthorizationSettings</a> - Change settings related to the current session.</li> <li>Added <a href="/method/account.changeAuthorizationSettings">account.changeAuthorizationSettings</a> - Change settings related to a session.</li>
<li>Added <a href="/method/channels.deleteParticipantHistory">channels.deleteParticipantHistory</a> - Delete all messages sent by a specific participant of a given supergroup</li> <li>Added <a href="/method/channels.deleteParticipantHistory">channels.deleteParticipantHistory</a> - Delete all messages sent by a specific participant of a given supergroup</li>
</ul> </ul>
<h5><a class="anchor" href="#changed-methods" id="changed-methods" name="changed-methods"><i class="anchor-icon"></i></a>Changed Methods</h5> <h5><a class="anchor" href="#changed-methods" id="changed-methods" name="changed-methods"><i class="anchor-icon"></i></a>Changed Methods</h5>

View file

@ -99,7 +99,7 @@
<tr> <tr>
<td><strong>unconfirmed</strong></td> <td><strong>unconfirmed</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.5?<a href="/constructor/true">true</a></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.5?<a href="/constructor/true">true</a></td>
<td> </td> <td>Whether the session is <a href="/api/auth#confirming-login">unconfirmed, see here »</a> for more info.</td>
</tr> </tr>
<tr> <tr>
<td><strong>hash</strong></td> <td><strong>hash</strong></td>

View file

@ -74,7 +74,7 @@
<tr> <tr>
<td><strong>unconfirmed</strong></td> <td><strong>unconfirmed</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/constructor/true">true</a></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/constructor/true">true</a></td>
<td> </td> <td>Whether the session is <a href="/api/auth#confirming-login">unconfirmed, see here »</a> for more info.</td>
</tr> </tr>
<tr> <tr>
<td><strong>hash</strong></td> <td><strong>hash</strong></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> <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 --> <!-- start req_pq_multi -->
<p>Sent payload (excluding transport headers/trailers):</p> <p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 3C 06 03 00 A7 E3 53 65 <pre><code>0000 | 00 00 00 00 00 00 00 00 1C 38 09 00 77 2F 55 65
0010 | 14 00 00 00 F1 8E 7E BE 87 54 F2 3A B4 CF 8B 0A 0010 | 14 00 00 00 F1 8E 7E BE 2E 43 2C 2D 21 17 81 12
0020 | 3C 1A 5F 51 8A B8 E7 94</code></pre> 0020 | 6D A7 CE 6E F1 B7 45 6B</code></pre>
<p>Payload (de)serialization:</p> <p>Payload (de)serialization:</p>
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre> <pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
<table class="table"> <table class="table">
@ -77,7 +77,7 @@
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>3C060300A7E35365</code></td> <td><code>1C380900772F5565</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> <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>
<tr> <tr>
@ -95,7 +95,7 @@
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Random number</td> <td>Random number</td>
</tr> </tr>
</tbody> </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> <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 --> <!-- start resPQ -->
<p>Received payload (excluding transport headers/trailers):</p> <p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 F4 4B 4C A7 E3 53 65 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 EC 39 27 77 2F 55 65
0010 | 80 00 00 00 63 24 16 05 87 54 F2 3A B4 CF 8B 0A 0010 | 84 00 00 00 63 24 16 05 2E 43 2C 2D 21 17 81 12
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | FF 69 78 AC 3E 15 77 69 08 29 52 0D D9 C5 1D 69 0030 | 39 A6 A5 A4 4C 02 D5 01 08 0E 20 2E 1B F7 E4 D0
0040 | 4F 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09 0040 | E1 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 0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
0060 | 85 1D 9D D0</code></pre> 0060 | 85 1D 9D D0</code></pre>
<p>Payload (de)serialization:</p> <p>Payload (de)serialization:</p>
@ -132,13 +132,13 @@
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>01F44B4CA7E35365</code></td> <td><code>01EC3927772F5565</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> <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>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
<td>16, 4</td> <td>16, 4</td>
<td><code>80000000</code> (128 in decimal)</td> <td><code>84000000</code> (132 in decimal)</td>
<td>Message body length</td> <td>Message body length</td>
</tr> </tr>
<tr> <tr>
@ -150,19 +150,19 @@
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Value generated by client in Step 1</td> <td>Value generated by client in Step 1</td>
</tr> </tr>
<tr> <tr>
<td>server_nonce</td> <td>server_nonce</td>
<td>40, 16</td> <td>40, 16</td>
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td> <td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td>Server-generated random number</td> <td>Server-generated random number</td>
</tr> </tr>
<tr> <tr>
<td>pq</td> <td>pq</td>
<td>56, 12</td> <td>56, 12</td>
<td><code>0829520DD9C51D694F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2977457532611422543</td> <td><code>080E202E1BF7E4D0E1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1017864213443694817</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td> <td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr> </tr>
<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> <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--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5> <h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<!-- start pq --> <!-- start pq -->
<pre><code>pq = 2977457532611422543</code></pre> <pre><code>pq = 1017864213443694817</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2977457532611422543 = 1615862537 * 1842642839</code></p> <p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1017864213443694817 = 1001404913 * 1016436209</code></p>
<pre><code>p = 1615862537 <pre><code>p = 1001404913
q = 1842642839</code></pre> q = 1016436209</code></pre>
<!-- end pq --> <!-- 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> <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> <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> <p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
<!-- start p_q_inner_data_dc --> <!-- start p_q_inner_data_dc -->
<p>Generated payload (excluding transport headers/trailers):</p> <p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 95 5F F5 A9 08 29 52 0D D9 C5 1D 69 4F 00 00 00 <pre><code>0000 | 95 5F F5 A9 08 0E 20 2E 1B F7 E4 D0 E1 00 00 00
0010 | 04 60 50 1B 09 00 00 00 04 6D D4 7F 97 00 00 00 0010 | 04 3B B0 39 F1 00 00 00 04 3C 95 95 F1 00 00 00
0020 | 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51 8A B8 E7 94 0020 | 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E F1 B7 45 6B
0030 | 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC 3E 15 77 69 0030 | 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4 4C 02 D5 01
0040 | 0F 0D 2B E2 18 FC AE 41 EB 36 96 6E 36 E7 D9 6D 0040 | D2 99 14 0C 54 81 B8 DB C3 F0 00 65 1A E0 14 AF
0050 | E1 80 E7 41 84 A6 E9 CF 1D 70 2C 59 54 E2 DF A0 0050 | E6 24 2C CA 50 6B DE 69 E7 81 62 68 FB 33 D4 12
0060 | 02 00 00 00</code></pre> 0060 | 02 00 00 00</code></pre>
<p>Payload (de)serialization:</p> <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> <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 = 1842642839</code></pre>
<tr> <tr>
<td>pq</td> <td>pq</td>
<td>4, 12</td> <td>4, 12</td>
<td><code>0829520DD9C51D694F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2977457532611422543</td> <td><code>080E202E1BF7E4D0E1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1017864213443694817</td>
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td> <td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
</tr> </tr>
<tr> <tr>
<td>p</td> <td>p</td>
<td>16, 8</td> <td>16, 8</td>
<td><code>0460501B09000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1615862537</td> <td><code>043BB039F1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1001404913</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td> <td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr> </tr>
<tr> <tr>
<td>q</td> <td>q</td>
<td>24, 8</td> <td>24, 8</td>
<td><code>046DD47F97000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1842642839</td> <td><code>043C9595F1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1016436209</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td> <td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr> </tr>
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>32, 16</td> <td>32, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Value generated by client in Step 1</td> <td>Value generated by client in Step 1</td>
</tr> </tr>
<tr> <tr>
<td>server_nonce</td> <td>server_nonce</td>
<td>48, 16</td> <td>48, 16</td>
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td> <td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
<td>new_nonce</td> <td>new_nonce</td>
<td>64, 32</td> <td>64, 32</td>
<td><code>0F0D2BE218FCAE41EB36966E36E7D96D</code> <code>E180E74184A6E9CF1D702C5954E2DFA0</code></td> <td><code>D299140C5481B8DBC3F000651AE014AF</code> <code>E6242CCA506BDE69E7816268FB33D412</code></td>
<td>Client-generated random number</td> <td>Client-generated random number</td>
</tr> </tr>
<tr> <tr>
@ -291,39 +291,39 @@ q = 1842642839</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> <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> 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 --> <!-- start p_q_inner_data_input -->
<pre><code>data = 955FF5A90829520DD9C51D694F0000000460501B09000000046DD47F970000008754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E1577690F0D2BE218FCAE41EB36966E36E7D96DE180E74184A6E9CF1D702C5954E2DFA002000000 <pre><code>data = 955FF5A9080E202E1BF7E4D0E1000000043BB039F1000000043C9595F10000002E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D501D299140C5481B8DBC3F000651AE014AFE6242CCA506BDE69E7816268FB33D41202000000
random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3F0006A060FED8C7399A4BEE95BE25C2DD9E9EA9960FA2C367D219A36FB7BD1B4D12A0DBD9DCED0348DCE0ABE7C09B5E86A5CEBAFDC6281ED38A537B5D9772A1</code></pre> random_padding_bytes = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139A5A02DF90B5F5F7BAA235BF79570D0C8621B252257CCCC42887DE397F83B42A653BBBB1182AE0AD93FCD9E0B8FCFCA49CFC3E077EDF9E82AE1DB2AD01ECC716</code></pre>
<!-- end p_q_inner_data_input --> <!-- end p_q_inner_data_input -->
<p>And this is the output:</p> <p>And this is the output:</p>
<!-- start p_q_inner_data_output --> <!-- start p_q_inner_data_output -->
<pre><code>encrypted_data = 48C017F4BBC9DF6717A695D2F76B9515B6A08DE23C9ECB2661AA22D6717B005E6345B7E48FF3837A30285841F8A4B236532E2E48F56486F934ADCA245370C4E00F0FDAF2CA001F0BB6F92BF8532D35B1EBD062B743F902BBCA9AEE371F749682B9A5EFAFEB5B03B21C00DED5EF54B1B287A592911FC984D1A6C45E26BB26A0A6D194887F3A5EB829AE9D32297782632EE1ABECF61DDDBBD70341E32E98AE3032DCCDCDA817EA7C035046267DE0A715673C8353CC95594520BD850654A0DABF78F842C075DD652955B870A301F6F48A158D453A96D66FD2490E5DC648506DBA6223E69CDF35A5C4D1D51A574BE1A716DA24872FFEE84F5BB8E8293B8501B2C8BF</code></pre> <pre><code>encrypted_data = 23ECB4204C6BE286A6DCA7DE73830B70209CB289052882E50682CC3F0BFAE7CCB92FA4E683A1FE06DF8CFA2A01BEA507DEE569A88A1CE8674DEABFE57125A66BC0CDD114DED3918D49C22B778704DBFA2AE73F7C52CB0B6989F0296601347F0659F337633BA09C8AA9CDB08F4162D61FD3B70A0E19316BFD919BEACBC39EFF7B0A80B8FECEEC345F82C637A0FB647A707007EE552F98577969BD0C1930F7010E344695FF0A51B4E6435172259159C7D2E128B14B3368E070006E30CF15AEFCF695E80F66E539AEFE48A74A9AEF17737F9C1437D1ED41A005F52C7ABBB955921639EF62AD3DA0B07AA38B88766290DB1FA2651DBC85EBD747AC363572BAB76AFA</code></pre>
<!-- end p_q_inner_data_output --> <!-- end p_q_inner_data_output -->
<p>The length of the final string is 256 bytes.</p> <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> <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 --> <!-- start req_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p> <p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 40 06 03 00 A7 E3 53 65 <pre><code>0000 | 00 00 00 00 00 00 00 00 20 38 09 00 77 2F 55 65
0010 | 40 01 00 00 BE E4 12 D7 87 54 F2 3A B4 CF 8B 0A 0010 | 40 01 00 00 BE E4 12 D7 2E 43 2C 2D 21 17 81 12
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | FF 69 78 AC 3E 15 77 69 04 60 50 1B 09 00 00 00 0030 | 39 A6 A5 A4 4C 02 D5 01 04 3B B0 39 F1 00 00 00
0040 | 04 6D D4 7F 97 00 00 00 85 FD 64 DE 85 1D 9D D0 0040 | 04 3C 95 95 F1 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 48 C0 17 F4 BB C9 DF 67 17 A6 95 D2 0050 | FE 00 01 00 23 EC B4 20 4C 6B E2 86 A6 DC A7 DE
0060 | F7 6B 95 15 B6 A0 8D E2 3C 9E CB 26 61 AA 22 D6 0060 | 73 83 0B 70 20 9C B2 89 05 28 82 E5 06 82 CC 3F
0070 | 71 7B 00 5E 63 45 B7 E4 8F F3 83 7A 30 28 58 41 0070 | 0B FA E7 CC B9 2F A4 E6 83 A1 FE 06 DF 8C FA 2A
0080 | F8 A4 B2 36 53 2E 2E 48 F5 64 86 F9 34 AD CA 24 0080 | 01 BE A5 07 DE E5 69 A8 8A 1C E8 67 4D EA BF E5
0090 | 53 70 C4 E0 0F 0F DA F2 CA 00 1F 0B B6 F9 2B F8 0090 | 71 25 A6 6B C0 CD D1 14 DE D3 91 8D 49 C2 2B 77
00A0 | 53 2D 35 B1 EB D0 62 B7 43 F9 02 BB CA 9A EE 37 00A0 | 87 04 DB FA 2A E7 3F 7C 52 CB 0B 69 89 F0 29 66
00B0 | 1F 74 96 82 B9 A5 EF AF EB 5B 03 B2 1C 00 DE D5 00B0 | 01 34 7F 06 59 F3 37 63 3B A0 9C 8A A9 CD B0 8F
00C0 | EF 54 B1 B2 87 A5 92 91 1F C9 84 D1 A6 C4 5E 26 00C0 | 41 62 D6 1F D3 B7 0A 0E 19 31 6B FD 91 9B EA CB
00D0 | BB 26 A0 A6 D1 94 88 7F 3A 5E B8 29 AE 9D 32 29 00D0 | C3 9E FF 7B 0A 80 B8 FE CE EC 34 5F 82 C6 37 A0
00E0 | 77 82 63 2E E1 AB EC F6 1D DD BB D7 03 41 E3 2E 00E0 | FB 64 7A 70 70 07 EE 55 2F 98 57 79 69 BD 0C 19
00F0 | 98 AE 30 32 DC CD CD A8 17 EA 7C 03 50 46 26 7D 00F0 | 30 F7 01 0E 34 46 95 FF 0A 51 B4 E6 43 51 72 25
0100 | E0 A7 15 67 3C 83 53 CC 95 59 45 20 BD 85 06 54 0100 | 91 59 C7 D2 E1 28 B1 4B 33 68 E0 70 00 6E 30 CF
0110 | A0 DA BF 78 F8 42 C0 75 DD 65 29 55 B8 70 A3 01 0110 | 15 AE FC F6 95 E8 0F 66 E5 39 AE FE 48 A7 4A 9A
0120 | F6 F4 8A 15 8D 45 3A 96 D6 6F D2 49 0E 5D C6 48 0120 | EF 17 73 7F 9C 14 37 D1 ED 41 A0 05 F5 2C 7A BB
0130 | 50 6D BA 62 23 E6 9C DF 35 A5 C4 D1 D5 1A 57 4B 0130 | B9 55 92 16 39 EF 62 AD 3D A0 B0 7A A3 8B 88 76
0140 | E1 A7 16 DA 24 87 2F FE E8 4F 5B B8 E8 29 3B 85 0140 | 62 90 DB 1F A2 65 1D BC 85 EB D7 47 AC 36 35 72
0150 | 01 B2 C8 BF</code></pre> 0150 | BA B7 6A FA</code></pre>
<p>Payload (de)serialization:</p> <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> <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"> <table class="table">
@ -345,7 +345,7 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>40060300A7E35365</code></td> <td><code>20380900772F5565</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> <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>
<tr> <tr>
@ -363,25 +363,25 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Value generated by client in Step 1</td> <td>Value generated by client in Step 1</td>
</tr> </tr>
<tr> <tr>
<td>server_nonce</td> <td>server_nonce</td>
<td>40, 16</td> <td>40, 16</td>
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td> <td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
<td>p</td> <td>p</td>
<td>56, 8</td> <td>56, 8</td>
<td><code>0460501B09000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1615862537</td> <td><code>043BB039F1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1001404913</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td> <td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr> </tr>
<tr> <tr>
<td>q</td> <td>q</td>
<td>64, 8</td> <td>64, 8</td>
<td><code>046DD47F97000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1842642839</td> <td><code>043C9595F1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1016436209</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td> <td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr> </tr>
<tr> <tr>
@ -393,7 +393,7 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3
<tr> <tr>
<td>encrypted_data</td> <td>encrypted_data</td>
<td>80, 260</td> <td>80, 260</td>
<td><code>FE00010048C017F4BBC9DF6717A695D2</code> <code>F76B9515B6A08DE23C9ECB2661AA22D6</code> <code>717B005E6345B7E48FF3837A30285841</code> <code>F8A4B236532E2E48F56486F934ADCA24</code> <code>5370C4E00F0FDAF2CA001F0BB6F92BF8</code> <code>532D35B1EBD062B743F902BBCA9AEE37</code> <code>1F749682B9A5EFAFEB5B03B21C00DED5</code> <code>EF54B1B287A592911FC984D1A6C45E26</code> <code>BB26A0A6D194887F3A5EB829AE9D3229</code> <code>7782632EE1ABECF61DDDBBD70341E32E</code> <code>98AE3032DCCDCDA817EA7C035046267D</code> <code>E0A715673C8353CC95594520BD850654</code> <code>A0DABF78F842C075DD652955B870A301</code> <code>F6F48A158D453A96D66FD2490E5DC648</code> <code>506DBA6223E69CDF35A5C4D1D51A574B</code> <code>E1A716DA24872FFEE84F5BB8E8293B85</code><br> <code>01B2C8BF</code></td> <td><code>FE00010023ECB4204C6BE286A6DCA7DE</code> <code>73830B70209CB289052882E50682CC3F</code> <code>0BFAE7CCB92FA4E683A1FE06DF8CFA2A</code> <code>01BEA507DEE569A88A1CE8674DEABFE5</code> <code>7125A66BC0CDD114DED3918D49C22B77</code> <code>8704DBFA2AE73F7C52CB0B6989F02966</code> <code>01347F0659F337633BA09C8AA9CDB08F</code> <code>4162D61FD3B70A0E19316BFD919BEACB</code> <code>C39EFF7B0A80B8FECEEC345F82C637A0</code> <code>FB647A707007EE552F98577969BD0C19</code> <code>30F7010E344695FF0A51B4E643517225</code> <code>9159C7D2E128B14B3368E070006E30CF</code> <code>15AEFCF695E80F66E539AEFE48A74A9A</code> <code>EF17737F9C1437D1ED41A005F52C7ABB</code> <code>B955921639EF62AD3DA0B07AA38B8876</code> <code>6290DB1FA2651DBC85EBD747AC363572</code><br> <code>BAB76AFA</code></td>
<td>Value generated above</td> <td>Value generated above</td>
</tr> </tr>
</tbody> </tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3
<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> <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 --> <!-- start server_DH_params_ok -->
<p>Received payload (excluding transport headers/trailers):</p> <p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 FC 65 FF A7 E3 53 65 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 9C 62 D9 77 2F 55 65
0010 | B4 02 00 00 5C 07 E8 D0 87 54 F2 3A B4 CF 8B 0A 0010 | 8C 02 00 00 5C 07 E8 D0 2E 43 2C 2D 21 17 81 12
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | FF 69 78 AC 3E 15 77 69 FE 50 02 00 EC 30 0C AA 0030 | 39 A6 A5 A4 4C 02 D5 01 FE 50 02 00 1D 7E 4E 4D
0040 | B8 20 19 C7 32 46 AC B1 BD 36 4D A4 1B 0C 87 86 0040 | 30 82 B4 0F D0 8B A8 CF 93 B4 37 64 7C E4 11 92
0050 | 89 2D 4C 6E C9 2D 11 74 CD 1D 42 4A 5E 22 08 39 0050 | 5A 51 B9 C8 26 4A E6 A5 F4 CA A3 A0 1D 6C C1 90
0060 | 86 4A 49 AF 37 77 EF BB 42 8C 8D D5 5E 7F 91 72 0060 | A0 64 C4 C2 11 FD 0A 10 B7 FA ED BE 20 04 BF 59
0070 | 18 39 05 99 0C 76 42 B1 41 24 3E B6 09 11 59 50 0070 | F3 99 A3 48 16 6C 86 E6 C9 74 D0 B8 6B E5 4F 0A
0080 | 4D 54 26 72 E2 5D 2C D5 10 8B F6 22 F5 16 14 C0 0080 | 99 A6 93 3F 02 13 E5 1C EC 42 56 21 13 DB E8 4B
0090 | 90 50 D0 1C 89 9D 1E B9 CB 8C 30 A8 C7 76 CF E2 0090 | A1 B7 78 B9 FD 55 94 02 03 6B BF C2 5D 66 2E 18
00A0 | 05 95 87 58 07 32 48 E7 D2 15 48 F9 A1 D4 02 99 00A0 | B2 CF 42 8A 9B 9A 5B 47 ED E6 F2 2F AB 31 93 90
00B0 | 9A A7 09 75 DC EF 08 10 B8 68 4F 2D 34 A7 BA 70 00B0 | 74 0D 09 15 D1 FC 68 8E 10 5B AF 32 F6 F0 1B 92
00C0 | 66 C7 10 E7 31 E5 5E 98 36 95 96 22 90 94 67 99 00C0 | 7D D2 E0 A9 D7 B0 1E C6 57 83 36 77 D5 84 B4 73
00D0 | CC 14 15 39 31 65 AA EA DC 40 6F 9E 01 B5 25 85 00D0 | 27 08 EA BA 5F BC EB 34 5A DF 5B 1F E6 B9 A1 58
00E0 | 2A DC BA 3D D4 FB D9 68 79 4B D3 58 E9 9E F3 39 00E0 | F5 D7 76 D0 84 A3 AB 53 80 60 0C D5 20 1E DE 4C
00F0 | 3B 2D 3B FD B5 BD D7 8B C3 37 4D DA 4C 4F 3D 25 00F0 | 9E D0 64 7E 1C 82 DF 55 0A B2 72 CD 96 D3 7D 33
0100 | 1A 04 6D 2C 0A 0D DE C4 27 75 90 BF DD 39 15 33 0100 | 40 63 89 D8 B4 A1 14 45 41 87 C1 4F F8 2E 84 B3
0110 | 53 CE 2D B1 EA FF CF 95 88 5F 75 42 67 7E 47 1D 0110 | 3A AC C6 13 D6 EF 50 E8 16 2E EB E0 A6 F2 61 3E
0120 | 12 21 C1 00 A5 9A 23 EC 5E 74 61 62 21 3E BC F2 0120 | 48 7B 7A BD DF 44 C4 FB FF 3F 19 DE 95 BC 39 53
0130 | 46 79 F2 F5 3F D4 E8 B3 41 CC 90 C8 38 8B 32 A0 0130 | 42 F0 E9 CA 0D 91 7B D7 0D A3 4D AC 1B 52 0B C5
0140 | 0F 9D F8 54 59 A4 71 18 12 AC 1C 64 13 DA 79 93 0140 | 68 EF 3F DB 1D 0B 6E 0D FB D1 C8 1C B1 FC 76 D0
0150 | D5 10 4E 72 BD CD 11 56 41 BF EF 70 ED 9B 8A 1D 0150 | 31 52 6F EA F4 E0 5F 02 92 4D 0E 00 2D E8 CC CC
0160 | E8 A2 09 81 4A A1 3D 13 95 87 5C 3C BE DF 4E B2 0160 | A2 0B F9 DB 5E BC B2 05 21 D4 B6 CB 24 1A 3A 89
0170 | 2D 09 B5 8F 24 D2 E5 17 DE 75 44 B7 CB 8E 8A 30 0170 | FC 79 62 4D 08 77 23 0B 18 98 AF 08 E0 07 79 6F
0180 | 4D 1C 11 4D 5B B2 F1 FA B6 AE 3A 0A 86 E9 1A 0D 0180 | F7 75 62 74 DD 3C FC 16 93 3D B8 3E 1A B0 45 6A
0190 | AE 70 4B CB 04 0A 37 22 66 6B 35 32 E0 55 4D CF 0190 | E1 5B 1D 35 BC D5 19 20 9C E4 38 2D EF 96 8F E5
01A0 | 64 DB FC B3 DB EC 8A 35 07 CC 64 48 36 2C D3 64 01A0 | D2 84 3A 02 DF 7D 61 11 23 45 17 51 1F 97 5F BD
01B0 | AE 56 45 BE FD 99 AB CF 32 72 88 F8 B9 91 04 A3 01B0 | 0A 08 D7 05 86 37 8C 83 11 1B 69 75 8A 14 9B 1B
01C0 | 3C 1C CD 07 19 F2 2A 2A C7 2A 45 5E A0 44 5B D5 01C0 | 44 09 D7 93 6D DA 3C 4C 7A 63 C8 69 6C B9 D5 8D
01D0 | 11 19 13 42 2D 19 09 C1 5F 34 98 71 A7 D1 F1 88 01D0 | 9B E6 AB 6B 76 40 A2 B5 4F DA B6 FF 06 A6 AB C1
01E0 | 71 B1 01 21 68 6B 9E 1C 93 32 1C BE F1 FD D7 D0 01E0 | AB ED F3 B3 D9 F3 43 D3 D9 87 D6 BA 57 C8 85 00
01F0 | 5B 65 6C 0D 79 E3 E7 58 71 61 2D EB 0A 01 C9 98 01F0 | 9E CA 3A BD 57 3F 7B DC 49 F4 B6 4E 69 73 1B B4
0200 | C7 A9 94 F4 25 C6 19 47 E3 26 F7 97 AB AF B7 75 0200 | 5F 66 3C CB 64 26 35 F6 F3 E8 88 65 1F DA F5 9C
0210 | AD E7 58 A8 08 A9 C4 76 59 60 27 8F 8E 33 E7 D0 0210 | 51 6A 13 D3 8B 77 74 48 31 97 98 EC 9E 72 4F 9C
0220 | ED 33 AE 40 BE CB B3 86 9D 59 E9 53 BB 19 71 3A 0220 | 5D D9 45 25 E6 E1 9A A0 49 55 FC 4C C3 9D 49 4B
0230 | F0 92 A4 12 C0 DB 06 52 FF 29 FA 4E 91 43 39 34 0230 | A7 6A DF 4B 9D F8 A5 28 1E 9B C5 F2 9F 16 0C 74
0240 | 2B 23 9B 65 AF 8F EF 34 FD 6F D3 C6 20 42 87 B7 0240 | B1 91 11 71 59 9E 68 31 5D 2A 51 6C 4A 73 46 41
0250 | DF 95 D5 DC E1 12 CB C1 E4 1D A2 2B 48 76 AA B0 0250 | 60 7C 2D 97 D6 F0 64 90 B2 5C 1C 67 1E 20 35 A9
0260 | 94 00 46 C1 35 B2 FF 3C 12 46 D6 B2 D9 3E D2 0C 0260 | B4 C1 A7 B5 94 69 3D 25 0E AC 4B 79 78 5D DA 64
0270 | ED D1 10 C2 AF B4 14 62 35 F6 A8 9D 4D 41 BC 7E 0270 | 89 6E E6 36 3C E9 D5 F4 1B 4F 85 CE DB BD 6F CA
0280 | 63 B0 4E 3E 9F 62 79 2F B5 D5 67 B3</code></pre> 0280 | 42 92 99 F8 FB 9A 4B 72 4F 2D 15 F6</code></pre>
<p>Payload (de)serialization:</p> <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> <pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
<table class="table"> <table class="table">
@ -464,13 +464,13 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>01FC65FFA7E35365</code></td> <td><code>019C62D9772F5565</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> <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>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
<td>16, 4</td> <td>16, 4</td>
<td><code>B4020000</code> (692 in decimal)</td> <td><code>8C020000</code> (652 in decimal)</td>
<td>Message body length</td> <td>Message body length</td>
</tr> </tr>
<tr> <tr>
@ -482,19 +482,19 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Value generated by client in Step 1</td> <td>Value generated by client in Step 1</td>
</tr> </tr>
<tr> <tr>
<td>server_nonce</td> <td>server_nonce</td>
<td>40, 16</td> <td>40, 16</td>
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td> <td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
<td>encrypted_answer</td> <td>encrypted_answer</td>
<td>56, 596</td> <td>56, 596</td>
<td><code>FE500200EC300CAAB82019C73246ACB1</code> <code>BD364DA41B0C8786892D4C6EC92D1174</code> <code>CD1D424A5E220839864A49AF3777EFBB</code> <code>428C8DD55E7F9172183905990C7642B1</code> <code>41243EB6091159504D542672E25D2CD5</code> <code>108BF622F51614C09050D01C899D1EB9</code> <code>CB8C30A8C776CFE205958758073248E7</code> <code>D21548F9A1D402999AA70975DCEF0810</code> <code>B8684F2D34A7BA7066C710E731E55E98</code> <code>3695962290946799CC1415393165AAEA</code> <code>DC406F9E01B525852ADCBA3DD4FBD968</code> <code>794BD358E99EF3393B2D3BFDB5BDD78B</code> <code>C3374DDA4C4F3D251A046D2C0A0DDEC4</code> <code>277590BFDD39153353CE2DB1EAFFCF95</code> <code>885F7542677E471D1221C100A59A23EC</code> <code>5E746162213EBCF24679F2F53FD4E8B3</code> <code>41CC90C8388B32A00F9DF85459A47118</code> <code>12AC1C6413DA7993D5104E72BDCD1156</code> <code>41BFEF70ED9B8A1DE8A209814AA13D13</code> <code>95875C3CBEDF4EB22D09B58F24D2E517</code> <code>DE7544B7CB8E8A304D1C114D5BB2F1FA</code> <code>B6AE3A0A86E91A0DAE704BCB040A3722</code> <code>666B3532E0554DCF64DBFCB3DBEC8A35</code> <code>07CC6448362CD364AE5645BEFD99ABCF</code> <code>327288F8B99104A33C1CCD0719F22A2A</code> <code>C72A455EA0445BD5111913422D1909C1</code> <code>5F349871A7D1F18871B10121686B9E1C</code> <code>93321CBEF1FDD7D05B656C0D79E3E758</code> <code>71612DEB0A01C998C7A994F425C61947</code> <code>E326F797ABAFB775ADE758A808A9C476</code> <code>5960278F8E33E7D0ED33AE40BECBB386</code> <code>9D59E953BB19713AF092A412C0DB0652</code> <code>FF29FA4E914339342B239B65AF8FEF34</code> <code>FD6FD3C6204287B7DF95D5DCE112CBC1</code> <code>E41DA22B4876AAB0940046C135B2FF3C</code> <code>1246D6B2D93ED20CEDD110C2AFB41462</code> <code>35F6A89D4D41BC7E63B04E3E9F62792F</code><br> <code>B5D567B3</code></td> <td><code>FE5002001D7E4E4D3082B40FD08BA8CF</code> <code>93B437647CE411925A51B9C8264AE6A5</code> <code>F4CAA3A01D6CC190A064C4C211FD0A10</code> <code>B7FAEDBE2004BF59F399A348166C86E6</code> <code>C974D0B86BE54F0A99A6933F0213E51C</code> <code>EC42562113DBE84BA1B778B9FD559402</code> <code>036BBFC25D662E18B2CF428A9B9A5B47</code> <code>EDE6F22FAB319390740D0915D1FC688E</code> <code>105BAF32F6F01B927DD2E0A9D7B01EC6</code> <code>57833677D584B4732708EABA5FBCEB34</code> <code>5ADF5B1FE6B9A158F5D776D084A3AB53</code> <code>80600CD5201EDE4C9ED0647E1C82DF55</code> <code>0AB272CD96D37D33406389D8B4A11445</code> <code>4187C14FF82E84B33AACC613D6EF50E8</code> <code>162EEBE0A6F2613E487B7ABDDF44C4FB</code> <code>FF3F19DE95BC395342F0E9CA0D917BD7</code> <code>0DA34DAC1B520BC568EF3FDB1D0B6E0D</code> <code>FBD1C81CB1FC76D031526FEAF4E05F02</code> <code>924D0E002DE8CCCCA20BF9DB5EBCB205</code> <code>21D4B6CB241A3A89FC79624D0877230B</code> <code>1898AF08E007796FF7756274DD3CFC16</code> <code>933DB83E1AB0456AE15B1D35BCD51920</code> <code>9CE4382DEF968FE5D2843A02DF7D6111</code> <code>234517511F975FBD0A08D70586378C83</code> <code>111B69758A149B1B4409D7936DDA3C4C</code> <code>7A63C8696CB9D58D9BE6AB6B7640A2B5</code> <code>4FDAB6FF06A6ABC1ABEDF3B3D9F343D3</code> <code>D987D6BA57C885009ECA3ABD573F7BDC</code> <code>49F4B64E69731BB45F663CCB642635F6</code> <code>F3E888651FDAF59C516A13D38B777448</code> <code>319798EC9E724F9C5DD94525E6E19AA0</code> <code>4955FC4CC39D494BA76ADF4B9DF8A528</code> <code>1E9BC5F29F160C74B1911171599E6831</code> <code>5D2A516C4A734641607C2D97D6F06490</code> <code>B25C1C671E2035A9B4C1A7B594693D25</code> <code>0EAC4B79785DDA64896EE6363CE9D5F4</code> <code>1B4F85CEDBBD6FCA429299F8FB9A4B72</code><br> <code>4F2D15F6</code></td>
<td>See below</td> <td>See below</td>
</tr> </tr>
</tbody> </tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3
<!-- end server_DH_params_ok --> <!-- 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> <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 --> <!-- start server_DH_inner_data_input -->
<pre><code>encrypted_answer = EC300CAAB82019C73246ACB1BD364DA41B0C8786892D4C6EC92D1174CD1D424A5E220839864A49AF3777EFBB428C8DD55E7F9172183905990C7642B141243EB6091159504D542672E25D2CD5108BF622F51614C09050D01C899D1EB9CB8C30A8C776CFE205958758073248E7D21548F9A1D402999AA70975DCEF0810B8684F2D34A7BA7066C710E731E55E983695962290946799CC1415393165AAEADC406F9E01B525852ADCBA3DD4FBD968794BD358E99EF3393B2D3BFDB5BDD78BC3374DDA4C4F3D251A046D2C0A0DDEC4277590BFDD39153353CE2DB1EAFFCF95885F7542677E471D1221C100A59A23EC5E746162213EBCF24679F2F53FD4E8B341CC90C8388B32A00F9DF85459A4711812AC1C6413DA7993D5104E72BDCD115641BFEF70ED9B8A1DE8A209814AA13D1395875C3CBEDF4EB22D09B58F24D2E517DE7544B7CB8E8A304D1C114D5BB2F1FAB6AE3A0A86E91A0DAE704BCB040A3722666B3532E0554DCF64DBFCB3DBEC8A3507CC6448362CD364AE5645BEFD99ABCF327288F8B99104A33C1CCD0719F22A2AC72A455EA0445BD5111913422D1909C15F349871A7D1F18871B10121686B9E1C93321CBEF1FDD7D05B656C0D79E3E75871612DEB0A01C998C7A994F425C61947E326F797ABAFB775ADE758A808A9C4765960278F8E33E7D0ED33AE40BECBB3869D59E953BB19713AF092A412C0DB0652FF29FA4E914339342B239B65AF8FEF34FD6FD3C6204287B7DF95D5DCE112CBC1E41DA22B4876AAB0940046C135B2FF3C1246D6B2D93ED20CEDD110C2AFB4146235F6A89D4D41BC7E63B04E3E9F62792FB5D567B3 <pre><code>encrypted_answer = 1D7E4E4D3082B40FD08BA8CF93B437647CE411925A51B9C8264AE6A5F4CAA3A01D6CC190A064C4C211FD0A10B7FAEDBE2004BF59F399A348166C86E6C974D0B86BE54F0A99A6933F0213E51CEC42562113DBE84BA1B778B9FD559402036BBFC25D662E18B2CF428A9B9A5B47EDE6F22FAB319390740D0915D1FC688E105BAF32F6F01B927DD2E0A9D7B01EC657833677D584B4732708EABA5FBCEB345ADF5B1FE6B9A158F5D776D084A3AB5380600CD5201EDE4C9ED0647E1C82DF550AB272CD96D37D33406389D8B4A114454187C14FF82E84B33AACC613D6EF50E8162EEBE0A6F2613E487B7ABDDF44C4FBFF3F19DE95BC395342F0E9CA0D917BD70DA34DAC1B520BC568EF3FDB1D0B6E0DFBD1C81CB1FC76D031526FEAF4E05F02924D0E002DE8CCCCA20BF9DB5EBCB20521D4B6CB241A3A89FC79624D0877230B1898AF08E007796FF7756274DD3CFC16933DB83E1AB0456AE15B1D35BCD519209CE4382DEF968FE5D2843A02DF7D6111234517511F975FBD0A08D70586378C83111B69758A149B1B4409D7936DDA3C4C7A63C8696CB9D58D9BE6AB6B7640A2B54FDAB6FF06A6ABC1ABEDF3B3D9F343D3D987D6BA57C885009ECA3ABD573F7BDC49F4B64E69731BB45F663CCB642635F6F3E888651FDAF59C516A13D38B777448319798EC9E724F9C5DD94525E6E19AA04955FC4CC39D494BA76ADF4B9DF8A5281E9BC5F29F160C74B1911171599E68315D2A516C4A734641607C2D97D6F06490B25C1C671E2035A9B4C1A7B594693D250EAC4B79785DDA64896EE6363CE9D5F41B4F85CEDBBD6FCA429299F8FB9A4B724F2D15F6
tmp_aes_key = 18BFF5E15D497FE20AE89092E2AF5E584F1274BC4BC69B1B5B963C844D43E90F tmp_aes_key = EE9089727DC03241E5CB7804BBA1A9ED63E7ABFC07D3D65A97E90D9011721485
tmp_aes_iv = 14D91E3D5A21F5C5055DDD1E6FB9F9295FA21AFD94BD2DAB211D7BB40F0D2BE2</code></pre> tmp_aes_iv = C999974CCB15BE1A71525735380F9F2B3D84B704F734CCEA9DFB2B02D299140C</code></pre>
<!-- end server_DH_inner_data_input --> <!-- end server_DH_inner_data_input -->
<p>Yielding:</p> <p>Yielding:</p>
<!-- start server_DH_inner_data_output --> <!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = EDF6E5D5B7B267DD24A8E9942989E5A9A2641503BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001006C6A8EBE0DAEDDED3B621DC52ACEEB0B0054D34234E0C7566408C59789A80A053970CC73EBBFDAFDBCEABAF17B920ABF7486E92A78B501C806B12B91AC3096EF649AE5CFA6C7035B02F2ADAC98628D0FF317D59E475B77363D28997F66C595B0D66EC1506EEADCCB92325A22893981CED27E0006861345CFBE9D36C91E177B7C5F1AF31695582D2350EAE97972D4138C6FF57A68E954A0F34E88D7CEE2C4BB8DF826E0BCE8194FCE35809C9A3D86DBAA1F77F841F55E5DD98D74761C13B8B316354521DE8E6484B3B45F212FA0AD3F408E527AD6286454F4B11E7FA51830B89DE2B97F6AD09ED33AEC9EE80E65988B399F83A8E7A58F148966F259C8E34E41E2A7E3536595D817C24AB5E551 <pre><code>answer_with_hash = 05533A31BBCBEFCEDC94220613DF0527C1379CAABA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010063ECDFAEB4AC2E0D2C0DF46F1CAC0341179355F058B7FCE39C4226BB97721E0A52BC3023C4734B4209A5FBEB6E0A39320E634736E75F89861FCB2EFF73C94C97AF32B08C61D58B5A2855F433657F7744E4DB6B6E6644BF5BF5179380D5810581923153F803458CA0146159B11D89B40D54F3AB5F0431CA533BDFE9A5F1F7D9E35F15026357790A295D1DD4A7775A53DECBE6217A123CA7E520729409B73AB30DC0B717BC8D35B00DB6E276BD618486A20507669FCDBAC10C7BFD10EA665BBAB8C3FF9FC408CA4454660D0546D2158ECD0CA946FFE617C66607A686CF503E72A97CF22C51F75273CAAF20D2B51F088F10013D4EE651C85D43350770FFDCABD95A772F55652DE622EC1B37DDDB
answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001006C6A8EBE0DAEDDED3B621DC52ACEEB0B0054D34234E0C7566408C59789A80A053970CC73EBBFDAFDBCEABAF17B920ABF7486E92A78B501C806B12B91AC3096EF649AE5CFA6C7035B02F2ADAC98628D0FF317D59E475B77363D28997F66C595B0D66EC1506EEADCCB92325A22893981CED27E0006861345CFBE9D36C91E177B7C5F1AF31695582D2350EAE97972D4138C6FF57A68E954A0F34E88D7CEE2C4BB8DF826E0BCE8194FCE35809C9A3D86DBAA1F77F841F55E5DD98D74761C13B8B316354521DE8E6484B3B45F212FA0AD3F408E527AD6286454F4B11E7FA51830B89DE2B97F6AD09ED33AEC9EE80E65988B399F83A8E7A58F148966F259C8E34E41E2A7E3536595D817C24AB5E551</code></pre> answer = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010063ECDFAEB4AC2E0D2C0DF46F1CAC0341179355F058B7FCE39C4226BB97721E0A52BC3023C4734B4209A5FBEB6E0A39320E634736E75F89861FCB2EFF73C94C97AF32B08C61D58B5A2855F433657F7744E4DB6B6E6644BF5BF5179380D5810581923153F803458CA0146159B11D89B40D54F3AB5F0431CA533BDFE9A5F1F7D9E35F15026357790A295D1DD4A7775A53DECBE6217A123CA7E520729409B73AB30DC0B717BC8D35B00DB6E276BD618486A20507669FCDBAC10C7BFD10EA665BBAB8C3FF9FC408CA4454660D0546D2158ECD0CA946FFE617C66607A686CF503E72A97CF22C51F75273CAAF20D2B51F088F10013D4EE651C85D43350770FFDCABD95A772F55652DE622EC1B37DDDB</code></pre>
<!-- end server_DH_inner_data_output --> <!-- end server_DH_inner_data_output -->
<!-- start server_DH_inner_data --> <!-- start server_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p> <p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | BA 0D 89 B5 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51 <pre><code>0000 | BA 0D 89 B5 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E
0010 | 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC 0010 | F1 B7 45 6B 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4
0020 | 3E 15 77 69 03 00 00 00 FE 00 01 00 C7 1C AE B9 0020 | 4C 02 D5 01 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 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 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 0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E
@ -532,23 +532,23 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776
0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 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 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 0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00
0130 | 6C 6A 8E BE 0D AE DD ED 3B 62 1D C5 2A CE EB 0B 0130 | 63 EC DF AE B4 AC 2E 0D 2C 0D F4 6F 1C AC 03 41
0140 | 00 54 D3 42 34 E0 C7 56 64 08 C5 97 89 A8 0A 05 0140 | 17 93 55 F0 58 B7 FC E3 9C 42 26 BB 97 72 1E 0A
0150 | 39 70 CC 73 EB BF DA FD BC EA BA F1 7B 92 0A BF 0150 | 52 BC 30 23 C4 73 4B 42 09 A5 FB EB 6E 0A 39 32
0160 | 74 86 E9 2A 78 B5 01 C8 06 B1 2B 91 AC 30 96 EF 0160 | 0E 63 47 36 E7 5F 89 86 1F CB 2E FF 73 C9 4C 97
0170 | 64 9A E5 CF A6 C7 03 5B 02 F2 AD AC 98 62 8D 0F 0170 | AF 32 B0 8C 61 D5 8B 5A 28 55 F4 33 65 7F 77 44
0180 | F3 17 D5 9E 47 5B 77 36 3D 28 99 7F 66 C5 95 B0 0180 | E4 DB 6B 6E 66 44 BF 5B F5 17 93 80 D5 81 05 81
0190 | D6 6E C1 50 6E EA DC CB 92 32 5A 22 89 39 81 CE 0190 | 92 31 53 F8 03 45 8C A0 14 61 59 B1 1D 89 B4 0D
01A0 | D2 7E 00 06 86 13 45 CF BE 9D 36 C9 1E 17 7B 7C 01A0 | 54 F3 AB 5F 04 31 CA 53 3B DF E9 A5 F1 F7 D9 E3
01B0 | 5F 1A F3 16 95 58 2D 23 50 EA E9 79 72 D4 13 8C 01B0 | 5F 15 02 63 57 79 0A 29 5D 1D D4 A7 77 5A 53 DE
01C0 | 6F F5 7A 68 E9 54 A0 F3 4E 88 D7 CE E2 C4 BB 8D 01C0 | CB E6 21 7A 12 3C A7 E5 20 72 94 09 B7 3A B3 0D
01D0 | F8 26 E0 BC E8 19 4F CE 35 80 9C 9A 3D 86 DB AA 01D0 | C0 B7 17 BC 8D 35 B0 0D B6 E2 76 BD 61 84 86 A2
01E0 | 1F 77 F8 41 F5 5E 5D D9 8D 74 76 1C 13 B8 B3 16 01E0 | 05 07 66 9F CD BA C1 0C 7B FD 10 EA 66 5B BA B8
01F0 | 35 45 21 DE 8E 64 84 B3 B4 5F 21 2F A0 AD 3F 40 01F0 | C3 FF 9F C4 08 CA 44 54 66 0D 05 46 D2 15 8E CD
0200 | 8E 52 7A D6 28 64 54 F4 B1 1E 7F A5 18 30 B8 9D 0200 | 0C A9 46 FF E6 17 C6 66 07 A6 86 CF 50 3E 72 A9
0210 | E2 B9 7F 6A D0 9E D3 3A EC 9E E8 0E 65 98 8B 39 0210 | 7C F2 2C 51 F7 52 73 CA AF 20 D2 B5 1F 08 8F 10
0220 | 9F 83 A8 E7 A5 8F 14 89 66 F2 59 C8 E3 4E 41 E2 0220 | 01 3D 4E E6 51 C8 5D 43 35 07 70 FF DC AB D9 5A
0230 | A7 E3 53 65</code></pre> 0230 | 77 2F 55 65</code></pre>
<p>Payload (de)serialization:</p> <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> <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"> <table class="table">
@ -570,13 +570,13 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>4, 16</td> <td>4, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Value generated by client in Step 1</td> <td>Value generated by client in Step 1</td>
</tr> </tr>
<tr> <tr>
<td>server_nonce</td> <td>server_nonce</td>
<td>20, 16</td> <td>20, 16</td>
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td> <td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
@ -594,13 +594,13 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776
<tr> <tr>
<td>g_a</td> <td>g_a</td>
<td>300, 260</td> <td>300, 260</td>
<td><code>FE0001006C6A8EBE0DAEDDED3B621DC5</code> <code>2ACEEB0B0054D34234E0C7566408C597</code> <code>89A80A053970CC73EBBFDAFDBCEABAF1</code> <code>7B920ABF7486E92A78B501C806B12B91</code> <code>AC3096EF649AE5CFA6C7035B02F2ADAC</code> <code>98628D0FF317D59E475B77363D28997F</code> <code>66C595B0D66EC1506EEADCCB92325A22</code> <code>893981CED27E0006861345CFBE9D36C9</code> <code>1E177B7C5F1AF31695582D2350EAE979</code> <code>72D4138C6FF57A68E954A0F34E88D7CE</code> <code>E2C4BB8DF826E0BCE8194FCE35809C9A</code> <code>3D86DBAA1F77F841F55E5DD98D74761C</code> <code>13B8B316354521DE8E6484B3B45F212F</code> <code>A0AD3F408E527AD6286454F4B11E7FA5</code> <code>1830B89DE2B97F6AD09ED33AEC9EE80E</code> <code>65988B399F83A8E7A58F148966F259C8</code><br> <code>E34E41E2</code></td> <td><code>FE00010063ECDFAEB4AC2E0D2C0DF46F</code> <code>1CAC0341179355F058B7FCE39C4226BB</code> <code>97721E0A52BC3023C4734B4209A5FBEB</code> <code>6E0A39320E634736E75F89861FCB2EFF</code> <code>73C94C97AF32B08C61D58B5A2855F433</code> <code>657F7744E4DB6B6E6644BF5BF5179380</code> <code>D5810581923153F803458CA0146159B1</code> <code>1D89B40D54F3AB5F0431CA533BDFE9A5</code> <code>F1F7D9E35F15026357790A295D1DD4A7</code> <code>775A53DECBE6217A123CA7E520729409</code> <code>B73AB30DC0B717BC8D35B00DB6E276BD</code> <code>618486A20507669FCDBAC10C7BFD10EA</code> <code>665BBAB8C3FF9FC408CA4454660D0546</code> <code>D2158ECD0CA946FFE617C66607A686CF</code> <code>503E72A97CF22C51F75273CAAF20D2B5</code> <code>1F088F10013D4EE651C85D43350770FF</code><br> <code>DCABD95A</code></td>
<td><code>g_a</code> diffie-hellman parameter</td> <td><code>g_a</code> diffie-hellman parameter</td>
</tr> </tr>
<tr> <tr>
<td>server_time</td> <td>server_time</td>
<td>560, 4</td> <td>560, 4</td>
<td><code>A7E35365</code> (1699996583 in decimal)</td> <td><code>772F5565</code> (1700081527 in decimal)</td>
<td>Server time</td> <td>Server time</td>
</tr> </tr>
</tbody> </tbody>
@ -609,34 +609,34 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776
<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> <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> <p>First, generate a secure random 2048-bit number b:</p>
<!-- start b --> <!-- start b -->
<pre><code>b = 525206EF8F2EB255A6766F5E808BA653C8C0A3BFA58E572E9EFC7F6DC4465855B1DB49D31D64EA233677DD39609B45B7788972B7C36720CA7D43090E3B3DFCE354A77B83A8FDD623F36CE06FA751DCBBF8869CD0C932EE2D1B2E183657605FBD624A68746C95DB1D0185CA9D8855E24D32B9D99D6B29CF1948974AFF7C9F8DA948603DC451E98A4A6D28216996841B326CE1F215882D1987D85D944BF42EC10B6633C7454B62DF67D7103C2576E1F4B42BC17539A470A8B2E14E7A2DCD9DFAE3959B2304E4D653FED74A1E7B6C81727686E394278DE1E7D588E8E6F27465B5AE655F21E2403181D02F338B237E58FF59DD3C0AE0BF6FE8B35F159BD1CACD60DA</code></pre> <pre><code>b = E6FB3B7B3A740733C365A0623A697FD0EF13458CD03A3E32BC9B91DE5B23C0E794CE0062630F12077BDFD16171FB4E907D3BB68C276590306DBBD270C49E937098E0E77ACD88756F646EDBB65E9F54347571A8FDED531CE9A547736A992CBD619B072075DBD643F12FB5DC322C668E48DF22DBCC1C7BE0721FCAE026FF0FE3C5851D64D6BB7D74AA860AC623DE25D60F2336242BC8A86E533ECC5C667DEBAF6EA08ECEB700397023F24C8B0C48654CE58C396B2C72FB0CABD93A9058812B7874B88466A1CA8FF89F727DF653B3D6713560F9DBC0FCE757400C8ABC26625E2FCDB254609CD230A6646242E252DD116466EF8A8324EFF4DA5365A11DAF410900C5</code></pre>
<!-- end b --> <!-- end b -->
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p> <p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
<!-- start g_b --> <!-- start g_b -->
<pre><code>g_b = 89EEA25E4698E4AA56CC3BBF4398CA8A8C46402A51ECF96CA737074047E0A835BE831839026ED65C714B74B113B258DFA74E472DB4B1A7C5AA41B369A361F92399B8D741BF4146593022CEA4E3E9DFE7900A5A2289BD8A546E586BF430E1411AFFA9C63C60AF79326F7D515B5FA4424BA06B67B4AD3DE23C8F4FC113079E030357BA3AA97A836C3A744C478CACAE1C62D795B6705972C816F18822699490D7F4A3C63BF6E3D43F370D405B075C2F333F1AEF1CA63BEDC373FD4C6509C837A65805BAE993B07F0CE563A8DE703389059245ACC381837821589EFC64439A225D7646DDE471D4D8167B9BF21A2B2AB06839CC595848B5D671BB78AA0C241A4B4AFC</code></pre> <pre><code>g_b = 26B5658C749730885AEFB3956B27BA6B24B3C50C6C7D9C986ECC9D71F8904E9A79018EC2034732C8D6FAC1FC3F01AC6DC40FBBF5EF171D21CACB63076FB71312AFB39C73B4AF3CFF0DC6D1681382A92A88253166FE0E20162E80C745D560670C9B1C66F885C4C8137376C1A4882FE8A4D6BAA59460D86AE479D1E9E3DF5007FC1CB208B0B385618D28DDD046EFB21D03A6718AB9F87D7168084EF5505419C00CF6A4A9F3968A376AE99F84FB48A949D821AA7EE3044BDA13993590089FCA46DEF8A42CC7F3B8E062A64C4B1645A1B16333A406D345772ABDFDB2B76A6E5D6C2D4CEC8734CD47359F478F90CBBE211A11F62AD73455637B86689BE47605CAA2B4</code></pre>
<!-- end g_b --> <!-- end g_b -->
<h6>7.1) generation of encrypted_data</h6> <h6>7.1) generation of encrypted_data</h6>
<!-- start client_DH_inner_data --> <!-- start client_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p> <p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 54 B6 43 66 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51 <pre><code>0000 | 54 B6 43 66 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E
0010 | 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC 0010 | F1 B7 45 6B 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4
0020 | 3E 15 77 69 00 00 00 00 00 00 00 00 FE 00 01 00 0020 | 4C 02 D5 01 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 89 EE A2 5E 46 98 E4 AA 56 CC 3B BF 43 98 CA 8A 0030 | 26 B5 65 8C 74 97 30 88 5A EF B3 95 6B 27 BA 6B
0040 | 8C 46 40 2A 51 EC F9 6C A7 37 07 40 47 E0 A8 35 0040 | 24 B3 C5 0C 6C 7D 9C 98 6E CC 9D 71 F8 90 4E 9A
0050 | BE 83 18 39 02 6E D6 5C 71 4B 74 B1 13 B2 58 DF 0050 | 79 01 8E C2 03 47 32 C8 D6 FA C1 FC 3F 01 AC 6D
0060 | A7 4E 47 2D B4 B1 A7 C5 AA 41 B3 69 A3 61 F9 23 0060 | C4 0F BB F5 EF 17 1D 21 CA CB 63 07 6F B7 13 12
0070 | 99 B8 D7 41 BF 41 46 59 30 22 CE A4 E3 E9 DF E7 0070 | AF B3 9C 73 B4 AF 3C FF 0D C6 D1 68 13 82 A9 2A
0080 | 90 0A 5A 22 89 BD 8A 54 6E 58 6B F4 30 E1 41 1A 0080 | 88 25 31 66 FE 0E 20 16 2E 80 C7 45 D5 60 67 0C
0090 | FF A9 C6 3C 60 AF 79 32 6F 7D 51 5B 5F A4 42 4B 0090 | 9B 1C 66 F8 85 C4 C8 13 73 76 C1 A4 88 2F E8 A4
00A0 | A0 6B 67 B4 AD 3D E2 3C 8F 4F C1 13 07 9E 03 03 00A0 | D6 BA A5 94 60 D8 6A E4 79 D1 E9 E3 DF 50 07 FC
00B0 | 57 BA 3A A9 7A 83 6C 3A 74 4C 47 8C AC AE 1C 62 00B0 | 1C B2 08 B0 B3 85 61 8D 28 DD D0 46 EF B2 1D 03
00C0 | D7 95 B6 70 59 72 C8 16 F1 88 22 69 94 90 D7 F4 00C0 | A6 71 8A B9 F8 7D 71 68 08 4E F5 50 54 19 C0 0C
00D0 | A3 C6 3B F6 E3 D4 3F 37 0D 40 5B 07 5C 2F 33 3F 00D0 | F6 A4 A9 F3 96 8A 37 6A E9 9F 84 FB 48 A9 49 D8
00E0 | 1A EF 1C A6 3B ED C3 73 FD 4C 65 09 C8 37 A6 58 00E0 | 21 AA 7E E3 04 4B DA 13 99 35 90 08 9F CA 46 DE
00F0 | 05 BA E9 93 B0 7F 0C E5 63 A8 DE 70 33 89 05 92 00F0 | F8 A4 2C C7 F3 B8 E0 62 A6 4C 4B 16 45 A1 B1 63
0100 | 45 AC C3 81 83 78 21 58 9E FC 64 43 9A 22 5D 76 0100 | 33 A4 06 D3 45 77 2A BD FD B2 B7 6A 6E 5D 6C 2D
0110 | 46 DD E4 71 D4 D8 16 7B 9B F2 1A 2B 2A B0 68 39 0110 | 4C EC 87 34 CD 47 35 9F 47 8F 90 CB BE 21 1A 11
0120 | CC 59 58 48 B5 D6 71 BB 78 AA 0C 24 1A 4B 4A FC</code></pre> 0120 | F6 2A D7 34 55 63 7B 86 68 9B E4 76 05 CA A2 B4</code></pre>
<p>Payload (de)serialization:</p> <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> <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"> <table class="table">
@ -658,19 +658,19 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>4, 16</td> <td>4, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Value generated by client in Step 1</td> <td>Value generated by client in Step 1</td>
</tr> </tr>
<tr> <tr>
<td>server_nonce</td> <td>server_nonce</td>
<td>20, 16</td> <td>20, 16</td>
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td> <td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
<td>g_b</td> <td>g_b</td>
<td>36, 260</td> <td>36, 260</td>
<td><code>FE00010089EEA25E4698E4AA56CC3BBF</code> <code>4398CA8A8C46402A51ECF96CA7370740</code> <code>47E0A835BE831839026ED65C714B74B1</code> <code>13B258DFA74E472DB4B1A7C5AA41B369</code> <code>A361F92399B8D741BF4146593022CEA4</code> <code>E3E9DFE7900A5A2289BD8A546E586BF4</code> <code>30E1411AFFA9C63C60AF79326F7D515B</code> <code>5FA4424BA06B67B4AD3DE23C8F4FC113</code> <code>079E030357BA3AA97A836C3A744C478C</code> <code>ACAE1C62D795B6705972C816F1882269</code> <code>9490D7F4A3C63BF6E3D43F370D405B07</code> <code>5C2F333F1AEF1CA63BEDC373FD4C6509</code> <code>C837A65805BAE993B07F0CE563A8DE70</code> <code>3389059245ACC381837821589EFC6443</code> <code>9A225D7646DDE471D4D8167B9BF21A2B</code> <code>2AB06839CC595848B5D671BB78AA0C24</code><br> <code>1A4B4AFC</code></td> <td><code>FE00010026B5658C749730885AEFB395</code> <code>6B27BA6B24B3C50C6C7D9C986ECC9D71</code> <code>F8904E9A79018EC2034732C8D6FAC1FC</code> <code>3F01AC6DC40FBBF5EF171D21CACB6307</code> <code>6FB71312AFB39C73B4AF3CFF0DC6D168</code> <code>1382A92A88253166FE0E20162E80C745</code> <code>D560670C9B1C66F885C4C8137376C1A4</code> <code>882FE8A4D6BAA59460D86AE479D1E9E3</code> <code>DF5007FC1CB208B0B385618D28DDD046</code> <code>EFB21D03A6718AB9F87D7168084EF550</code> <code>5419C00CF6A4A9F3968A376AE99F84FB</code> <code>48A949D821AA7EE3044BDA1399359008</code> <code>9FCA46DEF8A42CC7F3B8E062A64C4B16</code> <code>45A1B16333A406D345772ABDFDB2B76A</code> <code>6E5D6C2D4CEC8734CD47359F478F90CB</code> <code>BE211A11F62AD73455637B86689BE476</code><br> <code>05CAA2B4</code></td>
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td> <td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
</tr> </tr>
<tr> <tr>
@ -684,47 +684,47 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776
<!-- end client_DH_inner_data --> <!-- 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> <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 --> <!-- start client_DH_inner_data_input -->
<pre><code>data = 54B643668754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E1577690000000000000000FE00010089EEA25E4698E4AA56CC3BBF4398CA8A8C46402A51ECF96CA737074047E0A835BE831839026ED65C714B74B113B258DFA74E472DB4B1A7C5AA41B369A361F92399B8D741BF4146593022CEA4E3E9DFE7900A5A2289BD8A546E586BF430E1411AFFA9C63C60AF79326F7D515B5FA4424BA06B67B4AD3DE23C8F4FC113079E030357BA3AA97A836C3A744C478CACAE1C62D795B6705972C816F18822699490D7F4A3C63BF6E3D43F370D405B075C2F333F1AEF1CA63BEDC373FD4C6509C837A65805BAE993B07F0CE563A8DE703389059245ACC381837821589EFC64439A225D7646DDE471D4D8167B9BF21A2B2AB06839CC595848B5D671BB78AA0C241A4B4AFC <pre><code>data = 54B643662E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D5010000000000000000FE00010026B5658C749730885AEFB3956B27BA6B24B3C50C6C7D9C986ECC9D71F8904E9A79018EC2034732C8D6FAC1FC3F01AC6DC40FBBF5EF171D21CACB63076FB71312AFB39C73B4AF3CFF0DC6D1681382A92A88253166FE0E20162E80C745D560670C9B1C66F885C4C8137376C1A4882FE8A4D6BAA59460D86AE479D1E9E3DF5007FC1CB208B0B385618D28DDD046EFB21D03A6718AB9F87D7168084EF5505419C00CF6A4A9F3968A376AE99F84FB48A949D821AA7EE3044BDA13993590089FCA46DEF8A42CC7F3B8E062A64C4B1645A1B16333A406D345772ABDFDB2B76A6E5D6C2D4CEC8734CD47359F478F90CBBE211A11F62AD73455637B86689BE47605CAA2B4
padding = BF530E565913D52672F80775 padding = 42713D7C63F7A248A383EEA8
tmp_aes_key = 18BFF5E15D497FE20AE89092E2AF5E584F1274BC4BC69B1B5B963C844D43E90F tmp_aes_key = EE9089727DC03241E5CB7804BBA1A9ED63E7ABFC07D3D65A97E90D9011721485
tmp_aes_iv = 14D91E3D5A21F5C5055DDD1E6FB9F9295FA21AFD94BD2DAB211D7BB40F0D2BE2</code></pre> tmp_aes_iv = C999974CCB15BE1A71525735380F9F2B3D84B704F734CCEA9DFB2B02D299140C</code></pre>
<!-- end client_DH_inner_data_input --> <!-- end client_DH_inner_data_input -->
<p>Process:</p> <p>Process:</p>
<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16) <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> encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre>
<p>Output:</p> <p>Output:</p>
<!-- start client_DH_inner_data_output --> <!-- start client_DH_inner_data_output -->
<pre><code>encrypted_data = 2AA22937AAEE091A898926996CD6AF9F50030F64766F53943B6C834779643971582012CD4AC08D29D3CF34C57E6B598469E4852173E0071237CF35207691567826987E8856CAC4485F04B87B50DF10C089C524CC25E3718BC20D8E661A61BBC888BB0EC244DF2C766B462453FC576820D6C0DC253FF1873DC20B70344C22E71A86AB9FBE5DDCDC25E2FD37EAC43E4CC6F89206D26103CA8D877776F9494D9D54473E7A1A7ED815633AD3107B27933759D7FD93868C96F4EE36A268547C1E36F016E331AA5E1F2EBDDC5D381F5149AAD73B37EA375030BF1E7E537C30AA7F4BC16B9E394A1EE14A39A2233F69F69E1177C298B5CFA8216A3DB2E09A7B98C3DE609D0ECA405796BBFBED9EDF4C8CC048957AAE7EF2634F25B2656DD6DA6E0B31246E78A44605FEEACE9296843DD86AA46290337B48F3058E989C443887664B3A9CC28A333C8031AB776D893C2A5B67D115</code></pre> <pre><code>encrypted_data = 43B58FB3C3D12AFCE51B4DEA2511C55B73FF1AB30F1B6237E7748AA38A5521830D374B878D70617ED153DA684245C422FC52F80A5DABB1E14D90D3DB688759EF5D220069D33E64BE07B0C416EDE8CE755322FD36284F6C92127F6FA08EABF37F3BF2586779306B2B65D29470AC9FD28A767E2B8F67DDDBB0C5ED9AECB1F430DB284AAF487F8E8823DC285F43931D4C316AE869D98E329B7B3DB04C82228442ADFCB86A1A28F414F4BB67456A35BE9DBE0C922B841270D7F61FABC8F8E8B124B0A12A9DF3A796D823EABB640EDB6434702AA541B5C1253EB8B1A0EB1713D242C9F2A383AEE1764763C2EEE3B21612738E41094DD230D907338AC30442E952C525BCA32412899F72D5D3FA5A47B1674A2824978BC8414201C0B8B7074C5D3AA758411C630A90D381D5834DF7295A7A933C6D779D87831401483299F4101300B3CF2F7AF32C16377FF0BA111F5DCFB0FF2F</code></pre>
<!-- end client_DH_inner_data_output --> <!-- end client_DH_inner_data_output -->
<p>The length of the final string is 336 bytes.</p> <p>The length of the final string is 336 bytes.</p>
<h6>7.2) set_client_DH_params query</h6> <h6>7.2) set_client_DH_params query</h6>
<!-- start set_client_DH_params --> <!-- start set_client_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p> <p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 70 CC 03 00 A7 E3 53 65 <pre><code>0000 | 00 00 00 00 00 00 00 00 20 92 03 00 78 2F 55 65
0010 | 78 01 00 00 1F 5F 04 F5 87 54 F2 3A B4 CF 8B 0A 0010 | 78 01 00 00 1F 5F 04 F5 2E 43 2C 2D 21 17 81 12
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | FF 69 78 AC 3E 15 77 69 FE 50 01 00 2A A2 29 37 0030 | 39 A6 A5 A4 4C 02 D5 01 FE 50 01 00 43 B5 8F B3
0040 | AA EE 09 1A 89 89 26 99 6C D6 AF 9F 50 03 0F 64 0040 | C3 D1 2A FC E5 1B 4D EA 25 11 C5 5B 73 FF 1A B3
0050 | 76 6F 53 94 3B 6C 83 47 79 64 39 71 58 20 12 CD 0050 | 0F 1B 62 37 E7 74 8A A3 8A 55 21 83 0D 37 4B 87
0060 | 4A C0 8D 29 D3 CF 34 C5 7E 6B 59 84 69 E4 85 21 0060 | 8D 70 61 7E D1 53 DA 68 42 45 C4 22 FC 52 F8 0A
0070 | 73 E0 07 12 37 CF 35 20 76 91 56 78 26 98 7E 88 0070 | 5D AB B1 E1 4D 90 D3 DB 68 87 59 EF 5D 22 00 69
0080 | 56 CA C4 48 5F 04 B8 7B 50 DF 10 C0 89 C5 24 CC 0080 | D3 3E 64 BE 07 B0 C4 16 ED E8 CE 75 53 22 FD 36
0090 | 25 E3 71 8B C2 0D 8E 66 1A 61 BB C8 88 BB 0E C2 0090 | 28 4F 6C 92 12 7F 6F A0 8E AB F3 7F 3B F2 58 67
00A0 | 44 DF 2C 76 6B 46 24 53 FC 57 68 20 D6 C0 DC 25 00A0 | 79 30 6B 2B 65 D2 94 70 AC 9F D2 8A 76 7E 2B 8F
00B0 | 3F F1 87 3D C2 0B 70 34 4C 22 E7 1A 86 AB 9F BE 00B0 | 67 DD DB B0 C5 ED 9A EC B1 F4 30 DB 28 4A AF 48
00C0 | 5D DC DC 25 E2 FD 37 EA C4 3E 4C C6 F8 92 06 D2 00C0 | 7F 8E 88 23 DC 28 5F 43 93 1D 4C 31 6A E8 69 D9
00D0 | 61 03 CA 8D 87 77 76 F9 49 4D 9D 54 47 3E 7A 1A 00D0 | 8E 32 9B 7B 3D B0 4C 82 22 84 42 AD FC B8 6A 1A
00E0 | 7E D8 15 63 3A D3 10 7B 27 93 37 59 D7 FD 93 86 00E0 | 28 F4 14 F4 BB 67 45 6A 35 BE 9D BE 0C 92 2B 84
00F0 | 8C 96 F4 EE 36 A2 68 54 7C 1E 36 F0 16 E3 31 AA 00F0 | 12 70 D7 F6 1F AB C8 F8 E8 B1 24 B0 A1 2A 9D F3
0100 | 5E 1F 2E BD DC 5D 38 1F 51 49 AA D7 3B 37 EA 37 0100 | A7 96 D8 23 EA BB 64 0E DB 64 34 70 2A A5 41 B5
0110 | 50 30 BF 1E 7E 53 7C 30 AA 7F 4B C1 6B 9E 39 4A 0110 | C1 25 3E B8 B1 A0 EB 17 13 D2 42 C9 F2 A3 83 AE
0120 | 1E E1 4A 39 A2 23 3F 69 F6 9E 11 77 C2 98 B5 CF 0120 | E1 76 47 63 C2 EE E3 B2 16 12 73 8E 41 09 4D D2
0130 | A8 21 6A 3D B2 E0 9A 7B 98 C3 DE 60 9D 0E CA 40 0130 | 30 D9 07 33 8A C3 04 42 E9 52 C5 25 BC A3 24 12
0140 | 57 96 BB FB ED 9E DF 4C 8C C0 48 95 7A AE 7E F2 0140 | 89 9F 72 D5 D3 FA 5A 47 B1 67 4A 28 24 97 8B C8
0150 | 63 4F 25 B2 65 6D D6 DA 6E 0B 31 24 6E 78 A4 46 0150 | 41 42 01 C0 B8 B7 07 4C 5D 3A A7 58 41 1C 63 0A
0160 | 05 FE EA CE 92 96 84 3D D8 6A A4 62 90 33 7B 48 0160 | 90 D3 81 D5 83 4D F7 29 5A 7A 93 3C 6D 77 9D 87
0170 | F3 05 8E 98 9C 44 38 87 66 4B 3A 9C C2 8A 33 3C 0170 | 83 14 01 48 32 99 F4 10 13 00 B3 CF 2F 7A F3 2C
0180 | 80 31 AB 77 6D 89 3C 2A 5B 67 D1 15</code></pre> 0180 | 16 37 7F F0 BA 11 1F 5D CF B0 FF 2F</code></pre>
<p>Payload (de)serialization:</p> <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> <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"> <table class="table">
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>70CC0300A7E35365</code></td> <td><code>20920300782F5565</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> <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>
<tr> <tr>
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Value generated by client in Step 1</td> <td>Value generated by client in Step 1</td>
</tr> </tr>
<tr> <tr>
<td>server_nonce</td> <td>server_nonce</td>
<td>40, 16</td> <td>40, 16</td>
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td> <td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
<td>encrypted_data</td> <td>encrypted_data</td>
<td>56, 340</td> <td>56, 340</td>
<td><code>FE5001002AA22937AAEE091A89892699</code> <code>6CD6AF9F50030F64766F53943B6C8347</code> <code>79643971582012CD4AC08D29D3CF34C5</code> <code>7E6B598469E4852173E0071237CF3520</code> <code>7691567826987E8856CAC4485F04B87B</code> <code>50DF10C089C524CC25E3718BC20D8E66</code> <code>1A61BBC888BB0EC244DF2C766B462453</code> <code>FC576820D6C0DC253FF1873DC20B7034</code> <code>4C22E71A86AB9FBE5DDCDC25E2FD37EA</code> <code>C43E4CC6F89206D26103CA8D877776F9</code> <code>494D9D54473E7A1A7ED815633AD3107B</code> <code>27933759D7FD93868C96F4EE36A26854</code> <code>7C1E36F016E331AA5E1F2EBDDC5D381F</code> <code>5149AAD73B37EA375030BF1E7E537C30</code> <code>AA7F4BC16B9E394A1EE14A39A2233F69</code> <code>F69E1177C298B5CFA8216A3DB2E09A7B</code> <code>98C3DE609D0ECA405796BBFBED9EDF4C</code> <code>8CC048957AAE7EF2634F25B2656DD6DA</code> <code>6E0B31246E78A44605FEEACE9296843D</code> <code>D86AA46290337B48F3058E989C443887</code> <code>664B3A9CC28A333C8031AB776D893C2A</code><br> <code>5B67D115</code></td> <td><code>FE50010043B58FB3C3D12AFCE51B4DEA</code> <code>2511C55B73FF1AB30F1B6237E7748AA3</code> <code>8A5521830D374B878D70617ED153DA68</code> <code>4245C422FC52F80A5DABB1E14D90D3DB</code> <code>688759EF5D220069D33E64BE07B0C416</code> <code>EDE8CE755322FD36284F6C92127F6FA0</code> <code>8EABF37F3BF2586779306B2B65D29470</code> <code>AC9FD28A767E2B8F67DDDBB0C5ED9AEC</code> <code>B1F430DB284AAF487F8E8823DC285F43</code> <code>931D4C316AE869D98E329B7B3DB04C82</code> <code>228442ADFCB86A1A28F414F4BB67456A</code> <code>35BE9DBE0C922B841270D7F61FABC8F8</code> <code>E8B124B0A12A9DF3A796D823EABB640E</code> <code>DB6434702AA541B5C1253EB8B1A0EB17</code> <code>13D242C9F2A383AEE1764763C2EEE3B2</code> <code>1612738E41094DD230D907338AC30442</code> <code>E952C525BCA32412899F72D5D3FA5A47</code> <code>B1674A2824978BC8414201C0B8B7074C</code> <code>5D3AA758411C630A90D381D5834DF729</code> <code>5A7A933C6D779D87831401483299F410</code> <code>1300B3CF2F7AF32C16377FF0BA111F5D</code><br> <code>CFB0FF2F</code></td>
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td> <td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
</tr> </tr>
</tbody> </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> <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> <p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p>
<!-- start auth_key --> <!-- start auth_key -->
<pre><code>auth_key = 2814F03C98D79F97E37918AA54005773E19CF04FA1DEDF6CEF5A28B649CB335AA5C899A91EA062083CC0755E26F6AED4878C7E55CE33C8DFDC9F9A5729BD0B256BDDC6F5A568A709CB2E1ECB5DF262CC552AFF9DA9114C9EB01BAAC2A640CB801EE4630BCD5AD80983641B9911B0511958373DF15DFE156D6FA4991CCECBB01C42C10AAC4801F2DFF1725BA2A582388940D45958F742B0FF09CFE60BEB0971B1BF8CCD438A8F1BB77B2DD8A7325133C890B9905625404DB5A34B6838E6DBD001DEA92F6C9010A8AFC37888038D4DA8A3476E129ED2948ECE2A394943BA060CBA4BD790D6219CCE39547E49BD7920FA79C53D3530CDFE24875C6ECD300D1D5020</code></pre> <pre><code>auth_key = 80E188CDCC0FEBB560B9E1F8A2D8803A8E52EF0C629EB73E75B2C197971A4EBBD1ACA56D902A5D2CF9D6BB7E64853EE4606A66663D0590607DEFAB61D0548D2FCC12DF1F39C9A94FB41EFF7FEDAE2786F92C8208EE10118751AEBFE73A77F5F8A0ECA63FDC7F157DE28AED3F5E5A7BA1049ED69E30BFB66A62AFE75267D5857895D452D0EF9297C9B705DE40E414749C876A40DE99A9EDE803B39F2B74A613311F9ACB14146173048C1931E36984ADF1A8D52C35EA9EEDBDE5F9F9D718EBA2E5F1F16A4DA33C7FD3608FC36FF068EB6CED61F229850BCA84E33606F2456F0DC921F482DFB13FA35013D6010A545DCF1519FD53781C47EE4F2E0376673B4C3783</code></pre>
<!-- end auth_key --> <!-- 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> <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> <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 --> <!-- start dh_gen_ok -->
<p>Received payload (excluding transport headers/trailers):</p> <p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 C4 5B A8 E3 53 65 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 A8 DE 97 78 2F 55 65
0010 | 38 00 00 00 34 F7 CB 3B 87 54 F2 3A B4 CF 8B 0A 0010 | 5C 00 00 00 34 F7 CB 3B 2E 43 2C 2D 21 17 81 12
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | FF 69 78 AC 3E 15 77 69 16 C8 ED 7B 97 0A 71 7A 0030 | 39 A6 A5 A4 4C 02 D5 01 D5 89 78 EF 7B 68 27 29
0040 | F6 E4 86 DB 8C 8D 3A C4</code></pre> 0040 | 4A 27 29 83 33 1E D6 87</code></pre>
<p>Payload (de)serialization:</p> <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> <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"> <table class="table">
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>01E0C45BA8E35365</code></td> <td><code>01A8DE97782F5565</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> <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>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
<td>16, 4</td> <td>16, 4</td>
<td><code>38000000</code> (56 in decimal)</td> <td><code>5C000000</code> (92 in decimal)</td>
<td>Message body length</td> <td>Message body length</td>
</tr> </tr>
<tr> <tr>
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td> <td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td>Value generated by client in Step 1</td> <td>Value generated by client in Step 1</td>
</tr> </tr>
<tr> <tr>
<td>server_nonce</td> <td>server_nonce</td>
<td>40, 16</td> <td>40, 16</td>
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td> <td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
<td>new_nonce_hash1</td> <td>new_nonce_hash1</td>
<td>56, 16</td> <td>56, 16</td>
<td><code>16C8ED7B970A717AF6E486DB8C8D3AC4</code></td> <td><code>D58978EF7B6827294A272983331ED687</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> <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> </tr>
</tbody> </tbody>