Update content of files

This commit is contained in:
GitHub Action 2023-11-26 14:40:57 +00:00
parent 5a9677de19
commit 61ab4a71d4
11 changed files with 289 additions and 384 deletions

View file

@ -92,8 +92,8 @@ To fetch information about one or more topics by their ID, use <a href="/method/
<p>To send messages to the "General" topic, just use <a href="/method/messages.sendMessage">messages.sendMessage</a> as usual, as if you were writing to a normal supergroup.<br>
On the other hand, topics with <code>id != 1</code> are just the <a href="/api/threads">message thread</a> of the <a href="/constructor/messageActionTopicCreate">messageActionTopicCreate</a> service message that created that topic.<br>
This means that topics should be treated similarly to <a href="/api/threads">message threads</a> by the client.<br>
To send messages to these topics, pass the topic ID to the <code>reply_msg_id</code> parameter of <a href="/method/messages.sendMessage">messages.sendMessage</a>, <a href="/method/messages.sendMedia">messages.sendMedia</a> et cetera. </p>
<p>To reply to messages within a topic, pass the ID of the message to reply to to <a href="/constructor/inputReplyToMessage">inputReplyToMessage</a>.<code>reply_msg_id</code>, and, unless we're replying to a message in the "General" topic, pass the topic ID to <a href="/constructor/inputReplyToMessage">inputReplyToMessage</a>.<code>top_msg_id</code>.<br>
To send messages to these topics, pass the topic ID to the <code>reply_to_msg_id</code> parameter of <a href="/constructor/inputReplyToMessage">inputReplyToMessage</a>, passed to <code>reply_to</code> when invoking <a href="/method/messages.sendMessage">messages.sendMessage</a>, <a href="/method/messages.sendMedia">messages.sendMedia</a> et cetera. </p>
<p>To reply to messages within a topic, pass the ID of the message to reply to to <a href="/constructor/inputReplyToMessage">inputReplyToMessage</a>.<code>reply_to_msg_id</code>, and, unless we're replying to a message in the "General" topic, pass the topic ID to <a href="/constructor/inputReplyToMessage">inputReplyToMessage</a>.<code>top_msg_id</code>.<br>
Note that when replying to messages in a topic, the <a href="/constructor/inputReplyToMessage">inputReplyToMessage</a>.<code>top_msg_id</code> field must contain the topic ID <strong>if and only if</strong> we're replying to messages in <a href="/api/forum#forum-topics">forum topics</a> different from the "General" topic (i.e. <code>reply_to_msg_id</code> is set and <code>reply_to_msg_id != topicID</code> and <code>topicID != 1</code>): this way, if the replied-to message is deleted before the method finishes execution, the value in this field will be used to send the message to the correct topic, instead of the "General" topic.<br>
Also note that since <a href="/api/threads">message threads</a> can't have nested message threads, topics (except for the "General" topic) also can't have message threads (so replies to messages within topics won't generate further message threads). </p>
<p>Topics have a name (<code>title</code>) and an icon: the icon can be a <a href="/api/custom-emoji">custom emoji</a> specified by the <code>icon_emoji_id</code>, or a default chat icon if <code>icon_emoji_id</code> is not set, filled with the color specified in <code>icon_color</code>.<br>

View file

@ -69,9 +69,9 @@
<li>Added <a href="/method/stories.activateStealthMode">stories.activateStealthMode</a> - Activates <a href="/api/stories#stealth-mode">stories stealth mode</a>, see <a href="/api/stories#stealth-mode">here »</a> for more info.</li>
<li>Added <a href="/method/contacts.setBlocked">contacts.setBlocked</a> - Replace the contents of an entire <a href="/api/block">blocklist, see here for more info »</a>.</li>
<li>Added <a href="/method/stories.sendReaction">stories.sendReaction</a> - React to a story.</li>
<li>Added <a href="/method/bots.canSendMessage">bots.canSendMessage</a> - </li>
<li>Added <a href="/method/bots.allowSendMessage">bots.allowSendMessage</a> - </li>
<li>Added <a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a> - </li>
<li>Added <a href="/method/bots.canSendMessage">bots.canSendMessage</a> - Check whether the specified bot can send us messages</li>
<li>Added <a href="/method/bots.allowSendMessage">bots.allowSendMessage</a> - Allow the specified bot to send us messages</li>
<li>Added <a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a> - Send a custom request from a <a href="/api/bots/webapps">mini bot app</a></li>
<li>Added <a href="/method/stories.getPeerStories">stories.getPeerStories</a> - Fetch the full active <a href="/api/stories#watching-stories">story list</a> of a specific peer.</li>
<li>Added <a href="/method/stories.getAllReadPeerStories">stories.getAllReadPeerStories</a> - Obtain the latest read story ID for all peers when first logging in, returned as a list of <a href="/constructor/updateReadStories">updateReadStories</a> updates, see <a href="/api/stories#watching-stories">here »</a> for more info.</li>
<li>Added <a href="/method/stories.getPeerMaxIDs">stories.getPeerMaxIDs</a> - </li>

View file

@ -79,7 +79,7 @@
<h4><a class="anchor" href="#static-stickers" id="static-stickers" name="static-stickers"><i class="anchor-icon"></i></a>Static stickers</h4>
<p>Static stickers are <a href="https://en.wikipedia.org/wiki/WebP">WebP</a> images with the following specs:</p>
<ul>
<li>For stickers, either the width or height must be equal to 512 pixels.</li>
<li>For stickers, either width or height must be equal to 512 pixels.</li>
<li>For <a href="/api/custom-emoji">custom emojis</a>, the resolution must be equal to 100x100 pixels.</li>
<li>Transparency is supported.</li>
</ul>
@ -103,7 +103,7 @@
<ul>
<li>The video must be encoded using <a href="https://en.wikipedia.org/wiki/VP9">VP9</a>, in a <a href="https://en.wikipedia.org/wiki/WebM">WebM</a> container.</li>
<li>The <a href="https://en.wikipedia.org/wiki/WebM">WebM</a> container must have <strong>no audio stream</strong>.</li>
<li>For stickers, either the width or height must be equal to 512 pixels.</li>
<li>For stickers, either width or height must be equal to 512 pixels.</li>
<li>For <a href="/api/custom-emoji">custom emojis</a>, the resolution must be equal to 100x100 pixels.</li>
<li>Maximum duration: 3 seconds.</li>
<li>Frame rate: up to 30 FPS.</li>

View file

@ -4,40 +4,10 @@
<meta charset="utf-8">
<title>bots.allowSendMessage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
bot
InputUser
 
Result
Updates
Possible errors
Code
Type
Description
400
BOT_INVALID
This…">
<meta property="description" content="Allow the specified bot to send us messages">
<meta property="og:title" content="bots.allowSendMessage">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
bot
InputUser
 
Result
Updates
Possible errors
Code
Type
Description
400
BOT_INVALID
This…">
<meta property="og:description" content="Allow the specified bot to send us messages">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -72,7 +42,8 @@ This…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/bots.allowSendMessage" >bots.allowSendMessage</a></li></ul></div>
<h1 id="dev_page_title">bots.allowSendMessage</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Allow the specified bot to send us messages</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -106,7 +77,7 @@ This…">
<tr>
<td><strong>bot</strong></td>
<td style="text-align: center;"><a href="/type/InputUser">InputUser</a></td>
<td> </td>
<td>The bot</td>
</tr>
</tbody>
</table>

View file

@ -4,40 +4,10 @@
<meta charset="utf-8">
<title>bots.canSendMessage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
bot
InputUser
 
Result
Bool
Possible errors
Code
Type
Description
400
BOT_INVALID
This…">
<meta property="description" content="Check whether the specified bot can send us messages">
<meta property="og:title" content="bots.canSendMessage">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
bot
InputUser
 
Result
Bool
Possible errors
Code
Type
Description
400
BOT_INVALID
This…">
<meta property="og:description" content="Check whether the specified bot can send us messages">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -72,7 +42,8 @@ This…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/bots.canSendMessage" >bots.canSendMessage</a></li></ul></div>
<h1 id="dev_page_title">bots.canSendMessage</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Check whether the specified bot can send us messages</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -101,7 +72,7 @@ This…">
<tr>
<td><strong>bot</strong></td>
<td style="text-align: center;"><a href="/type/InputUser">InputUser</a></td>
<td> </td>
<td>The bot</td>
</tr>
</tbody>
</table>

View file

@ -4,40 +4,10 @@
<meta charset="utf-8">
<title>bots.invokeWebViewCustomMethod</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
bot
InputUser
 
custom_method
string
 
params
DataJSON
 
Result
DataJSON
Possible errors…">
<meta property="description" content="Send a custom request from a mini bot app">
<meta property="og:title" content="bots.invokeWebViewCustomMethod">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
bot
InputUser
 
custom_method
string
 
params
DataJSON
 
Result
DataJSON
Possible errors…">
<meta property="og:description" content="Send a custom request from a mini bot app">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -72,7 +42,8 @@ Possible errors…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/bots.invokeWebViewCustomMethod" >bots.invokeWebViewCustomMethod</a></li></ul></div>
<h1 id="dev_page_title">bots.invokeWebViewCustomMethod</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Send a custom request from a <a href="/api/bots/webapps">mini bot app</a></p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -100,17 +71,17 @@ Possible errors…">
<tr>
<td><strong>bot</strong></td>
<td style="text-align: center;"><a href="/type/InputUser">InputUser</a></td>
<td> </td>
<td>Identifier of the bot associated to the <a href="/api/bots/webapps">mini bot app</a></td>
</tr>
<tr>
<td><strong>custom_method</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td>
<td> </td>
<td>Identifier of the custom method to invoke</td>
</tr>
<tr>
<td><strong>params</strong></td>
<td style="text-align: center;"><a href="/type/DataJSON">DataJSON</a></td>
<td> </td>
<td>Method parameters</td>
</tr>
</tbody>
</table>
@ -132,7 +103,10 @@ Possible errors…">
<td>This is not a valid bot.</td>
</tr>
</tbody>
</table></div>
</table>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#mini-apps-on-telegram" id="mini-apps-on-telegram" name="mini-apps-on-telegram"><i class="anchor-icon"></i></a><a href="/api/bots/webapps">Mini Apps on Telegram</a></h4>
<p>Bots can offer users interactive HTML5 web apps to completely replace any website.</p></div>
</div>

View file

@ -1285,6 +1285,57 @@ Look for updates of telegram&#39;s terms of service…">
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#working-with-mini-bot-apps-" id="working-with-mini-bot-apps-" name="working-with-mini-bot-apps-"><i class="anchor-icon"></i></a>Working with <a href="/bots/webapps">mini bot apps »</a></h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/method/messages.requestWebView">messages.requestWebView</a></td>
<td>Open a <a href="/bots/webapps">bot mini app</a>, sending over user information after user confirmation.<br><br>After calling this method, until the user closes the webview, <a href="/method/messages.prolongWebView">messages.prolongWebView</a> must be called every 60 seconds.</td>
</tr>
<tr>
<td><a href="/method/messages.prolongWebView">messages.prolongWebView</a></td>
<td>Indicate to the server (from the user side) that the user is still using a web app.<br><br>If the method returns a <code>QUERY_ID_INVALID</code> error, the webview must be closed.</td>
</tr>
<tr>
<td><a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a></td>
<td>Open a <a href="/api/bots/webapps">bot mini app</a>.</td>
</tr>
<tr>
<td><a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a></td>
<td>Terminate webview interaction started with <a href="/method/messages.requestWebView">messages.requestWebView</a>, sending the specified message to the chat on behalf of the user.</td>
</tr>
<tr>
<td><a href="/method/messages.sendWebViewData">messages.sendWebViewData</a></td>
<td>Used by the user to relay data from an opened <a href="/api/bots/webapps">reply keyboard bot mini app</a> to the bot that owns it.</td>
</tr>
<tr>
<td><a href="/method/messages.requestAppWebView">messages.requestAppWebView</a></td>
<td>Open a <a href="/bots/webapps">bot mini app</a> from a <a href="/api/links#named-bot-mini-app-links">named bot mini app deep link</a>, sending over user information after user confirmation.<br><br>After calling this method, until the user closes the webview, <a href="/method/messages.prolongWebView">messages.prolongWebView</a> must be called every 60 seconds.</td>
</tr>
<tr>
<td><a href="/method/messages.getBotApp">messages.getBotApp</a></td>
<td>Obtain information about a <a href="/api/bots/webapps#named-bot-mini-apps">named bot mini app</a></td>
</tr>
<tr>
<td><a href="/method/bots.canSendMessage">bots.canSendMessage</a></td>
<td>Check whether the specified bot can send us messages</td>
</tr>
<tr>
<td><a href="/method/bots.allowSendMessage">bots.allowSendMessage</a></td>
<td>Allow the specified bot to send us messages</td>
</tr>
<tr>
<td><a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a></td>
<td>Send a custom request from a <a href="/api/bots/webapps">mini bot app</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#working-with-secret-chats" id="working-with-secret-chats" name="working-with-secret-chats"><i class="anchor-icon"></i></a>Working with <a href="/api/end-to-end">secret chats</a></h3>
<table class="table">
<thead>
@ -1725,45 +1776,6 @@ Look for updates of telegram&#39;s terms of service…">
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#working-with-web-app-bots-" id="working-with-web-app-bots-" name="working-with-web-app-bots-"><i class="anchor-icon"></i></a>Working with <a href="/bots/webapps">web app bots »</a></h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/method/messages.requestWebView">messages.requestWebView</a></td>
<td>Open a <a href="/bots/webapps">bot mini app</a>, sending over user information after user confirmation.<br><br>After calling this method, until the user closes the webview, <a href="/method/messages.prolongWebView">messages.prolongWebView</a> must be called every 60 seconds.</td>
</tr>
<tr>
<td><a href="/method/messages.prolongWebView">messages.prolongWebView</a></td>
<td>Indicate to the server (from the user side) that the user is still using a web app.<br><br>If the method returns a <code>QUERY_ID_INVALID</code> error, the webview must be closed.</td>
</tr>
<tr>
<td><a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a></td>
<td>Open a <a href="/api/bots/webapps">bot mini app</a>.</td>
</tr>
<tr>
<td><a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a></td>
<td>Terminate webview interaction started with <a href="/method/messages.requestWebView">messages.requestWebView</a>, sending the specified message to the chat on behalf of the user.</td>
</tr>
<tr>
<td><a href="/method/messages.sendWebViewData">messages.sendWebViewData</a></td>
<td>Used by the user to relay data from an opened <a href="/api/bots/webapps">reply keyboard bot mini app</a> to the bot that owns it.</td>
</tr>
<tr>
<td><a href="/method/messages.requestAppWebView">messages.requestAppWebView</a></td>
<td>Open a <a href="/bots/webapps">bot mini app</a> from a <a href="/api/links#named-bot-mini-app-links">named bot mini app deep link</a>, sending over user information after user confirmation.<br><br>After calling this method, until the user closes the webview, <a href="/method/messages.prolongWebView">messages.prolongWebView</a> must be called every 60 seconds.</td>
</tr>
<tr>
<td><a href="/method/messages.getBotApp">messages.getBotApp</a></td>
<td>Obtain information about a <a href="/api/bots/webapps#named-bot-mini-apps">named bot mini app</a></td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#working-with-bot-admin-right-suggestions" id="working-with-bot-admin-right-suggestions" name="working-with-bot-admin-right-suggestions"><i class="anchor-icon"></i></a>Working with bot admin right suggestions</h3>
<table class="table">
<thead>
@ -2786,7 +2798,7 @@ Look for updates of telegram&#39;s terms of service…">
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#working-with-the-attachment-menu--of-web-app-bots-" id="working-with-the-attachment-menu--of-web-app-bots-" name="working-with-the-attachment-menu--of-web-app-bots-"><i class="anchor-icon"></i></a>Working with the <a href="/bots/webapps#launching-mini-apps-from-the-attachment-menu">attachment menu »</a> of <a href="/bots/webapps">web app bots »</a></h3>
<h3><a class="anchor" href="#working-with-the-attachment-menu--of-mini-bot-apps-" id="working-with-the-attachment-menu--of-mini-bot-apps-" name="working-with-the-attachment-menu--of-mini-bot-apps-"><i class="anchor-icon"></i></a>Working with the <a href="/bots/webapps#launching-mini-apps-from-the-attachment-menu">attachment menu »</a> of <a href="/bots/webapps">mini bot apps »</a></h3>
<table class="table">
<thead>
<tr>
@ -2983,29 +2995,6 @@ Look for updates of telegram&#39;s terms of service…">
<td>Resolve a @username to get peer info</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#other" id="other" name="other"><i class="anchor-icon"></i></a>Other</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/method/bots.canSendMessage">bots.canSendMessage</a></td>
<td> </td>
</tr>
<tr>
<td><a href="/method/bots.allowSendMessage">bots.allowSendMessage</a></td>
<td> </td>
</tr>
<tr>
<td><a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a></td>
<td> </td>
</tr>
</tbody>
</table></div>
</div>

View file

@ -53,9 +53,9 @@
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
<!-- start req_pq_multi -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 BC 20 0A 00 54 B3 5F 65
0010 | 14 00 00 00 F1 8E 7E BE D3 C7 6C F7 7D 76 D6 35
0020 | 46 A4 97 C0 42 3D FC 7C</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 30 77 07 00 87 BE 5F 65
0010 | 14 00 00 00 F1 8E 7E BE C5 C3 32 D6 45 03 48 05
0020 | 91 60 C5 28 28 1E 97 E0</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
<table class="table">
@ -77,7 +77,7 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>BC200A0054B35F65</code></td>
<td><code>3077070087BE5F65</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -95,7 +95,7 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,11 +104,11 @@
<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5>
<!-- start resPQ -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 9C 77 FF 54 B3 5F 65
0010 | 60 00 00 00 63 24 16 05 D3 C7 6C F7 7D 76 D6 35
0020 | 46 A4 97 C0 42 3D FC 7C 50 9F E3 CA 67 09 F9 B8
0030 | 73 01 F3 45 D6 43 08 4B 08 1E 27 F3 4F A8 42 ED
0040 | 61 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 84 AE 0B 88 BE 5F 65
0010 | 6C 00 00 00 63 24 16 05 C5 C3 32 D6 45 03 48 05
0020 | 91 60 C5 28 28 1E 97 E0 F3 B9 88 0B 9B 75 11 CA
0030 | C6 72 4D AA E4 EE 54 A4 08 18 EA CC 21 D4 DB EB
0040 | F7 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
0060 | 85 1D 9D D0</code></pre>
<p>Payload (de)serialization:</p>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>019C77FF54B35F65</code></td>
<td><code>0184AE0B88BE5F65</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>60000000</code> (96 in decimal)</td>
<td><code>6C000000</code> (108 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>509FE3CA6709F9B87301F345D643084B</code></td>
<td><code>F3B9880B9B7511CAC6724DAAE4EE54A4</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081E27F34FA842ED61000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2172972868680478049</td>
<td><code>0818EACC21D4DBEBF7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1795471847137733623</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -208,22 +208,22 @@
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<!-- start pq -->
<pre><code>pq = 2172972868680478049</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2172972868680478049 = 1263580933 * 1719694253</code></p>
<pre><code>p = 1263580933
q = 1719694253</code></pre>
<pre><code>pq = 1795471847137733623</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1795471847137733623 = 1093348747 * 1642176709</code></p>
<pre><code>p = 1093348747
q = 1642176709</code></pre>
<!-- end pq -->
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
<!-- start p_q_inner_data_dc -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 95 5F F5 A9 08 1E 27 F3 4F A8 42 ED 61 00 00 00
0010 | 04 4B 50 B7 05 00 00 00 04 66 80 73 AD 00 00 00
0020 | D3 C7 6C F7 7D 76 D6 35 46 A4 97 C0 42 3D FC 7C
0030 | 50 9F E3 CA 67 09 F9 B8 73 01 F3 45 D6 43 08 4B
0040 | 26 DA C4 84 89 FD E6 FD D0 4F F0 95 2D 9F 30 64
0050 | 47 CA 81 E3 4C 32 B0 21 6C A8 EC B1 BA F7 8D 82
<pre><code>0000 | 95 5F F5 A9 08 18 EA CC 21 D4 DB EB F7 00 00 00
0010 | 04 41 2B 2D 8B 00 00 00 04 61 E1 A0 C5 00 00 00
0020 | C5 C3 32 D6 45 03 48 05 91 60 C5 28 28 1E 97 E0
0030 | F3 B9 88 0B 9B 75 11 CA C6 72 4D AA E4 EE 54 A4
0040 | B2 FF A0 0C 16 1D CA DB B4 C1 E5 7D B4 95 E6 DF
0050 | 49 05 1E EF A6 0A 46 BC EA 0B B4 4F 1D 5C 76 0E
0060 | 02 00 00 00</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;</code></pre>
@ -246,37 +246,37 @@ q = 1719694253</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081E27F34FA842ED61000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2172972868680478049</td>
<td><code>0818EACC21D4DBEBF7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1795471847137733623</td>
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>p</td>
<td>16, 8</td>
<td><code>044B50B705000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1263580933</td>
<td><code>04412B2D8B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1093348747</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>24, 8</td>
<td><code>04668073AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1719694253</td>
<td><code>0461E1A0C5000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1642176709</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>nonce</td>
<td>32, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>509FE3CA6709F9B87301F345D643084B</code></td>
<td><code>F3B9880B9B7511CAC6724DAAE4EE54A4</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>26DAC48489FDE6FDD04FF0952D9F3064</code> <code>47CA81E34C32B0216CA8ECB1BAF78D82</code></td>
<td><code>B2FFA00C161DCADBB4C1E57DB495E6DF</code> <code>49051EEFA60A46BCEA0BB44F1D5C760E</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1719694253</code></pre>
<p>The serialization of <em>P_Q_inner_data</em> produces <strong>data</strong>, which is used to generate <strong>encrypted_data</strong> as specified in <a href="/mtproto/auth_key">step 4.1</a>.<br>
These are the inputs to the algorithm specified in <a href="/mtproto/auth_key">step 4.1</a>:</p>
<!-- start p_q_inner_data_input -->
<pre><code>data = 955FF5A9081E27F34FA842ED61000000044B50B70500000004668073AD000000D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084B26DAC48489FDE6FDD04FF0952D9F306447CA81E34C32B0216CA8ECB1BAF78D8202000000
random_padding_bytes = C1C01D642E4BC7F519FC61A4D33B649C753B77441903A159E7E7EA6B65972F0E092E4B71D0689C50BD2FA87485E2CD451B3C842C973EDB59900D21B2BB18CD2B37860F2C95227911149221EC686679AFA76CD30695B46EF2039E235E</code></pre>
<pre><code>data = 955FF5A90818EACC21D4DBEBF700000004412B2D8B0000000461E1A0C5000000C5C332D6450348059160C528281E97E0F3B9880B9B7511CAC6724DAAE4EE54A4B2FFA00C161DCADBB4C1E57DB495E6DF49051EEFA60A46BCEA0BB44F1D5C760E02000000
random_padding_bytes = 80C2E0C1169CDE0D1D0E2723E1744C579FA59D85773D5DD8E373B150B00D1D701167ABE8551AC6FF2155B6BE9C1FC8E0E624294363FEA2D735D40D49099AE9A76FDB7F8A971568973AEFBE04C583A2FF49554F715E28A482DA2C0B44</code></pre>
<!-- end p_q_inner_data_input -->
<p>And this is the output:</p>
<!-- start p_q_inner_data_output -->
<pre><code>encrypted_data = B29490390AC9CF440758BDF18319C0CAD5EA6787E13C6342C7BA88B80190F41A11CE3C61BD62D5735202D04A92E061B846D421D0FF16B64B8E67F96851C702C3705979818282141E009241CC0DA2FEAA75FBAEC812C4F61221D746D6AE9C70A208EC49C8B52EA105FF390FC2D7A4758670B02E20D3D34770B8470E9EAB0D989B187642E4A1700CEEF87AD519AAE7B5E8D0AE660953128F254B180701EB0F50C809D1537DD7399439A0B4A1005243DC79A3C6ECFF336C4A7275655F0DF0AB582B819E5FBC4ADFEB6D77769F55C90095ADB2509E31853876953E543A0B52D6B86135A6102718BF8567CA1EB814C35DF13EC2F5151A5618CC4B17622B7862127870</code></pre>
<pre><code>encrypted_data = A0BC2038AD38F2705B26F59AE7DDB0F4360171470BA0B008B838361B1608604010336DB09174B0BEF8894F7E036E1D34FD34A56D1B3001851537E6916151646DC6CDA44FE7C16C32AE05AE2E048BE92913CC11EBE8F3515205734C99B922C647082E2139CB76972E9A150D955B41F5A26699F43549815B59A09490C34FD68EA411F94E0931671C3C82FB4CD57AE67C35EEC01247E644D12F71D72512C1441B3460B1E970DC4B5D3FF764FADCD15A9FC07D2E656F259A5D781CD553061436279CC52D84F65153581444CCE1D100111AFCA88193BF4C206B09109CB6BF773DD547EED1340E9853E41A3212C6BEE4EDB9904357F512DDEAB99874B8E798C62CEF0E</code></pre>
<!-- end p_q_inner_data_output -->
<p>The length of the final string is 256 bytes.</p>
<h5><a class="anchor" href="#5-send-req-dh-params-query-with-generated-encrypted-data" id="5-send-req-dh-params-query-with-generated-encrypted-data" name="5-send-req-dh-params-query-with-generated-encrypted-data"><i class="anchor-icon"></i></a>5) Send req_DH_params query with generated <code>encrypted_data</code></h5>
<!-- start req_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 7C E5 01 00 55 B3 5F 65
0010 | 40 01 00 00 BE E4 12 D7 D3 C7 6C F7 7D 76 D6 35
0020 | 46 A4 97 C0 42 3D FC 7C 50 9F E3 CA 67 09 F9 B8
0030 | 73 01 F3 45 D6 43 08 4B 04 4B 50 B7 05 00 00 00
0040 | 04 66 80 73 AD 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 B2 94 90 39 0A C9 CF 44 07 58 BD F1
0060 | 83 19 C0 CA D5 EA 67 87 E1 3C 63 42 C7 BA 88 B8
0070 | 01 90 F4 1A 11 CE 3C 61 BD 62 D5 73 52 02 D0 4A
0080 | 92 E0 61 B8 46 D4 21 D0 FF 16 B6 4B 8E 67 F9 68
0090 | 51 C7 02 C3 70 59 79 81 82 82 14 1E 00 92 41 CC
00A0 | 0D A2 FE AA 75 FB AE C8 12 C4 F6 12 21 D7 46 D6
00B0 | AE 9C 70 A2 08 EC 49 C8 B5 2E A1 05 FF 39 0F C2
00C0 | D7 A4 75 86 70 B0 2E 20 D3 D3 47 70 B8 47 0E 9E
00D0 | AB 0D 98 9B 18 76 42 E4 A1 70 0C EE F8 7A D5 19
00E0 | AA E7 B5 E8 D0 AE 66 09 53 12 8F 25 4B 18 07 01
00F0 | EB 0F 50 C8 09 D1 53 7D D7 39 94 39 A0 B4 A1 00
0100 | 52 43 DC 79 A3 C6 EC FF 33 6C 4A 72 75 65 5F 0D
0110 | F0 AB 58 2B 81 9E 5F BC 4A DF EB 6D 77 76 9F 55
0120 | C9 00 95 AD B2 50 9E 31 85 38 76 95 3E 54 3A 0B
0130 | 52 D6 B8 61 35 A6 10 27 18 BF 85 67 CA 1E B8 14
0140 | C3 5D F1 3E C2 F5 15 1A 56 18 CC 4B 17 62 2B 78
0150 | 62 12 78 70</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 00 B6 0B 00 88 BE 5F 65
0010 | 40 01 00 00 BE E4 12 D7 C5 C3 32 D6 45 03 48 05
0020 | 91 60 C5 28 28 1E 97 E0 F3 B9 88 0B 9B 75 11 CA
0030 | C6 72 4D AA E4 EE 54 A4 04 41 2B 2D 8B 00 00 00
0040 | 04 61 E1 A0 C5 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 A0 BC 20 38 AD 38 F2 70 5B 26 F5 9A
0060 | E7 DD B0 F4 36 01 71 47 0B A0 B0 08 B8 38 36 1B
0070 | 16 08 60 40 10 33 6D B0 91 74 B0 BE F8 89 4F 7E
0080 | 03 6E 1D 34 FD 34 A5 6D 1B 30 01 85 15 37 E6 91
0090 | 61 51 64 6D C6 CD A4 4F E7 C1 6C 32 AE 05 AE 2E
00A0 | 04 8B E9 29 13 CC 11 EB E8 F3 51 52 05 73 4C 99
00B0 | B9 22 C6 47 08 2E 21 39 CB 76 97 2E 9A 15 0D 95
00C0 | 5B 41 F5 A2 66 99 F4 35 49 81 5B 59 A0 94 90 C3
00D0 | 4F D6 8E A4 11 F9 4E 09 31 67 1C 3C 82 FB 4C D5
00E0 | 7A E6 7C 35 EE C0 12 47 E6 44 D1 2F 71 D7 25 12
00F0 | C1 44 1B 34 60 B1 E9 70 DC 4B 5D 3F F7 64 FA DC
0100 | D1 5A 9F C0 7D 2E 65 6F 25 9A 5D 78 1C D5 53 06
0110 | 14 36 27 9C C5 2D 84 F6 51 53 58 14 44 CC E1 D1
0120 | 00 11 1A FC A8 81 93 BF 4C 20 6B 09 10 9C B6 BF
0130 | 77 3D D5 47 EE D1 34 0E 98 53 E4 1A 32 12 C6 BE
0140 | E4 ED B9 90 43 57 F5 12 DD EA B9 98 74 B8 E7 98
0150 | C6 2C EF 0E</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;</code></pre>
<table class="table">
@ -345,7 +345,7 @@ random_padding_bytes = C1C01D642E4BC7F519FC61A4D33B649C753B77441903A159E7E7EA6B6
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>7CE5010055B35F65</code></td>
<td><code>00B60B0088BE5F65</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -363,25 +363,25 @@ random_padding_bytes = C1C01D642E4BC7F519FC61A4D33B649C753B77441903A159E7E7EA6B6
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>509FE3CA6709F9B87301F345D643084B</code></td>
<td><code>F3B9880B9B7511CAC6724DAAE4EE54A4</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>044B50B705000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1263580933</td>
<td><code>04412B2D8B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1093348747</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>64, 8</td>
<td><code>04668073AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1719694253</td>
<td><code>0461E1A0C5000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1642176709</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -393,7 +393,7 @@ random_padding_bytes = C1C01D642E4BC7F519FC61A4D33B649C753B77441903A159E7E7EA6B6
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE000100B29490390AC9CF440758BDF1</code> <code>8319C0CAD5EA6787E13C6342C7BA88B8</code> <code>0190F41A11CE3C61BD62D5735202D04A</code> <code>92E061B846D421D0FF16B64B8E67F968</code> <code>51C702C3705979818282141E009241CC</code> <code>0DA2FEAA75FBAEC812C4F61221D746D6</code> <code>AE9C70A208EC49C8B52EA105FF390FC2</code> <code>D7A4758670B02E20D3D34770B8470E9E</code> <code>AB0D989B187642E4A1700CEEF87AD519</code> <code>AAE7B5E8D0AE660953128F254B180701</code> <code>EB0F50C809D1537DD7399439A0B4A100</code> <code>5243DC79A3C6ECFF336C4A7275655F0D</code> <code>F0AB582B819E5FBC4ADFEB6D77769F55</code> <code>C90095ADB2509E31853876953E543A0B</code> <code>52D6B86135A6102718BF8567CA1EB814</code> <code>C35DF13EC2F5151A5618CC4B17622B78</code><br> <code>62127870</code></td>
<td><code>FE000100A0BC2038AD38F2705B26F59A</code> <code>E7DDB0F4360171470BA0B008B838361B</code> <code>1608604010336DB09174B0BEF8894F7E</code> <code>036E1D34FD34A56D1B3001851537E691</code> <code>6151646DC6CDA44FE7C16C32AE05AE2E</code> <code>048BE92913CC11EBE8F3515205734C99</code> <code>B922C647082E2139CB76972E9A150D95</code> <code>5B41F5A26699F43549815B59A09490C3</code> <code>4FD68EA411F94E0931671C3C82FB4CD5</code> <code>7AE67C35EEC01247E644D12F71D72512</code> <code>C1441B3460B1E970DC4B5D3FF764FADC</code> <code>D15A9FC07D2E656F259A5D781CD55306</code> <code>1436279CC52D84F65153581444CCE1D1</code> <code>00111AFCA88193BF4C206B09109CB6BF</code> <code>773DD547EED1340E9853E41A3212C6BE</code> <code>E4EDB9904357F512DDEAB99874B8E798</code><br> <code>C62CEF0E</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = C1C01D642E4BC7F519FC61A4D33B649C753B77441903A159E7E7EA6B6
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
<!-- start server_DH_params_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 14 9F B8 55 B3 5F 65
0010 | E0 02 00 00 5C 07 E8 D0 D3 C7 6C F7 7D 76 D6 35
0020 | 46 A4 97 C0 42 3D FC 7C 50 9F E3 CA 67 09 F9 B8
0030 | 73 01 F3 45 D6 43 08 4B FE 50 02 00 66 D3 81 F4
0040 | 67 5B 7D 30 8F 41 FB 24 4E DB 36 89 A8 34 04 47
0050 | DB 35 BD 19 0F B2 E2 8A D3 B0 F6 73 4A C8 09 9D
0060 | 7D DB DA 11 AE E7 CA FD 5B AC 7C 3A CF 7D BF 4B
0070 | E4 44 3B 82 2C E7 04 67 67 AE 39 22 2F 0B 79 02
0080 | 1E 7C 45 90 CA 22 A9 48 75 B4 93 05 87 F7 5A 2F
0090 | 77 86 DA 91 6E 82 59 77 F8 47 29 AA 8E 0D 1A CD
00A0 | 94 AB E7 C3 CB F2 13 80 8F 36 2E 34 83 2D 4E BD
00B0 | EC 44 B2 39 C2 45 10 64 10 BF 91 CB D5 DB B1 A8
00C0 | C1 D8 B9 D7 DD 4C D4 26 B4 B9 F9 86 93 A4 DD 56
00D0 | 2F 32 3C 3F 95 CA D8 16 88 43 92 36 13 79 55 2E
00E0 | A9 3E AE FA FA 2A FB 37 C0 3A 6F 7C 73 7D DF D0
00F0 | 9E 60 14 38 89 7E BA 18 C7 B7 3E 98 D9 DB 31 52
0100 | BA 44 43 60 4C 93 C7 84 74 D3 EA 77 61 0F CC B5
0110 | 42 AB 09 98 37 D7 AA AD 63 C2 A4 E0 8D 05 A2 A8
0120 | 5D 9A 31 B9 E2 D4 BB 0A DE 62 71 18 1B 26 F8 00
0130 | 62 65 84 42 6B B4 E7 14 C1 79 DE 8E C1 B7 06 C4
0140 | C4 7A 43 DC 2B 6E 29 E8 DD 91 D6 96 FF 05 02 1C
0150 | 21 11 75 A4 9F A1 40 EF BE 10 BF 74 3E 9C E2 58
0160 | EC 49 C6 19 8E F9 50 B1 1A 1B 7C F2 DD C5 A4 95
0170 | 40 AF 6E 38 40 10 9B E1 FD F9 55 41 86 B5 9E D3
0180 | 7B E7 0F FB 73 AD 88 45 5B EE C8 C2 6E E8 7E 9F
0190 | 0C A7 93 9E 99 49 1F AE 13 4A B1 45 1E 1E C1 4A
01A0 | DA 97 27 BC 40 13 35 AC 82 FB 5F AE 55 B8 09 26
01B0 | F1 11 D6 1E 9D 2A 38 04 5A 91 FC 46 BD 85 EA CC
01C0 | 65 B6 A0 E2 C2 B4 AA AF BE AA 79 DE F4 FE 10 EC
01D0 | CF 3E 45 40 39 F8 8A B5 9B FA A6 13 5C 28 B4 2D
01E0 | 24 9D 78 FB EB D4 1E 63 7D D3 89 27 A5 EF 81 CF
01F0 | 27 95 E2 C1 3A 75 67 9C DB 77 C6 F2 47 74 3D C9
0200 | 4D E7 4D 94 83 44 9D 80 63 FF 24 E9 1B 80 3F A4
0210 | 62 63 A7 D1 90 0D FE A9 88 56 40 3A 9E 9C 76 E9
0220 | 1A 00 34 23 18 4D EC 1D 11 78 37 93 6C 29 D9 B7
0230 | 33 6C C4 F7 6D 42 E0 29 48 5C E4 2F A2 F0 23 D3
0240 | 01 33 C2 48 4F CC F7 8D FC 06 9B 5A 41 02 2F 7E
0250 | 2E 2E B6 D6 0D F8 F6 B2 34 64 02 3A A6 94 9C 39
0260 | 2D 97 4A A9 60 E1 78 F6 04 49 31 F0 32 EB F8 C0
0270 | B5 3B 01 D4 50 72 6F ED E5 55 64 06 6E FF B2 B1
0280 | F8 27 31 DA 90 B8 DC 44 F9 73 E6 BD</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A8 0F BA 88 BE 5F 65
0010 | 84 02 00 00 5C 07 E8 D0 C5 C3 32 D6 45 03 48 05
0020 | 91 60 C5 28 28 1E 97 E0 F3 B9 88 0B 9B 75 11 CA
0030 | C6 72 4D AA E4 EE 54 A4 FE 50 02 00 BF 98 68 CC
0040 | 58 EA 65 1C 43 E6 E8 97 DA B4 8B 90 8A DB 0C 0D
0050 | C8 54 E6 A6 4F 6F 3E E6 B6 B0 3F 7C 9E EE 47 42
0060 | EC 00 D5 39 99 AF B1 22 CB 05 1A B1 EE 7D 7C 04
0070 | 81 27 7F 1E 96 7F 95 E6 B7 AA 39 CA 0B 47 13 04
0080 | 7B 21 02 FF B1 EA E3 41 53 6E FB C6 82 28 41 DB
0090 | 3A 9E 6F 4B B2 FA 3B 7C 1F A3 40 19 8E 53 71 7C
00A0 | 31 11 61 5E 39 B9 81 B3 D3 48 C9 28 40 FB 42 E7
00B0 | 0C 7E FF 37 F2 C6 4A DB 60 0A 91 BC 7D 2F A1 43
00C0 | 83 B2 95 69 67 B5 D2 11 57 E6 01 D5 9E C5 02 CA
00D0 | F7 FF D4 43 93 9B 0F A4 73 C4 FC C3 71 ED 60 20
00E0 | D8 F2 16 99 63 36 BC ED 57 EF 4C AF D6 0D 58 01
00F0 | 66 73 3E 09 2A 2A 50 28 A3 40 11 EC E1 79 DC 96
0100 | DF B1 C6 C4 DF 3B 8B 91 E7 25 51 91 BD A7 61 75
0110 | 9B 2F 5F 80 A6 51 CB E7 EC 76 EA A3 64 29 89 DA
0120 | 5B C3 3F 0E B3 94 7C 8F 80 4F 2E 19 16 B2 B1 81
0130 | ED FA B7 FE 5C FD 8A CF EC C1 88 93 63 34 82 9C
0140 | 5E FC A5 8A 58 6D 7A C2 81 88 98 F1 C8 16 AC CA
0150 | 32 76 BB FA 08 06 7B E6 7A 04 72 67 55 B1 D4 C2
0160 | 01 7E 63 13 5C 5C CF 7B 09 8A 6A 7E 0A D5 2D 09
0170 | 6B EC 4F B1 D2 A3 37 CE 32 5A C8 30 55 3F 51 5D
0180 | 32 B1 50 FC 69 4A 7A 58 A6 33 1F F3 56 4E F8 C6
0190 | CA 31 1F DF 57 D2 9D 4E D8 E6 88 F3 17 71 39 81
01A0 | B1 E0 15 4E 39 0C 76 38 2F 59 D6 28 BE 18 4A BC
01B0 | A7 DE 9A 1E 45 50 F2 D7 9B 22 3C 52 20 FA 3B A4
01C0 | 8C F8 E1 29 B9 7F 74 21 86 2C 16 65 5F 13 54 53
01D0 | 36 6C 7A B8 72 F2 59 FB 1C DB A9 4A E1 97 F5 2A
01E0 | 5E 45 41 94 73 EC 76 2B 1E DC DF 80 64 1C 60 37
01F0 | 4C 23 3C A6 DE 50 3C 61 6E 11 70 59 FA CA 6F E9
0200 | DF E1 8B EC 5D 03 C9 CE C3 49 FB 33 66 20 20 99
0210 | 22 DA 1A 8E FC A5 33 9E 80 8D 2A 94 CE 77 CE AA
0220 | 15 3B 88 D0 40 95 8F 14 87 C3 57 4B 31 2E DB 98
0230 | 40 70 62 AB B4 60 47 62 2E CB 29 6B 44 0B B0 0E
0240 | 08 3E 44 FF 09 B9 C9 98 E2 2A CE CF C7 88 DF 08
0250 | 2B F4 30 16 D1 2D DF 9B 6A C1 57 29 4A D3 93 EC
0260 | 94 0B B7 1D 50 2B 5C 86 E2 DC ED 0F 80 A2 B4 A5
0270 | 8A D9 50 74 A8 54 A4 D1 3E C4 60 27 8D A2 67 19
0280 | A6 CC 23 94 31 D8 05 10 F8 37 27 14</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
<table class="table">
@ -464,13 +464,13 @@ random_padding_bytes = C1C01D642E4BC7F519FC61A4D33B649C753B77441903A159E7E7EA6B6
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01149FB855B35F65</code></td>
<td><code>01A80FBA88BE5F65</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>E0020000</code> (736 in decimal)</td>
<td><code>84020000</code> (644 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = C1C01D642E4BC7F519FC61A4D33B649C753B77441903A159E7E7EA6B6
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>509FE3CA6709F9B87301F345D643084B</code></td>
<td><code>F3B9880B9B7511CAC6724DAAE4EE54A4</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE50020066D381F4675B7D308F41FB24</code> <code>4EDB3689A8340447DB35BD190FB2E28A</code> <code>D3B0F6734AC8099D7DDBDA11AEE7CAFD</code> <code>5BAC7C3ACF7DBF4BE4443B822CE70467</code> <code>67AE39222F0B79021E7C4590CA22A948</code> <code>75B4930587F75A2F7786DA916E825977</code> <code>F84729AA8E0D1ACD94ABE7C3CBF21380</code> <code>8F362E34832D4EBDEC44B239C2451064</code> <code>10BF91CBD5DBB1A8C1D8B9D7DD4CD426</code> <code>B4B9F98693A4DD562F323C3F95CAD816</code> <code>884392361379552EA93EAEFAFA2AFB37</code> <code>C03A6F7C737DDFD09E601438897EBA18</code> <code>C7B73E98D9DB3152BA4443604C93C784</code> <code>74D3EA77610FCCB542AB099837D7AAAD</code> <code>63C2A4E08D05A2A85D9A31B9E2D4BB0A</code> <code>DE6271181B26F800626584426BB4E714</code> <code>C179DE8EC1B706C4C47A43DC2B6E29E8</code> <code>DD91D696FF05021C211175A49FA140EF</code> <code>BE10BF743E9CE258EC49C6198EF950B1</code> <code>1A1B7CF2DDC5A49540AF6E3840109BE1</code> <code>FDF9554186B59ED37BE70FFB73AD8845</code> <code>5BEEC8C26EE87E9F0CA7939E99491FAE</code> <code>134AB1451E1EC14ADA9727BC401335AC</code> <code>82FB5FAE55B80926F111D61E9D2A3804</code> <code>5A91FC46BD85EACC65B6A0E2C2B4AAAF</code> <code>BEAA79DEF4FE10ECCF3E454039F88AB5</code> <code>9BFAA6135C28B42D249D78FBEBD41E63</code> <code>7DD38927A5EF81CF2795E2C13A75679C</code> <code>DB77C6F247743DC94DE74D9483449D80</code> <code>63FF24E91B803FA46263A7D1900DFEA9</code> <code>8856403A9E9C76E91A003423184DEC1D</code> <code>117837936C29D9B7336CC4F76D42E029</code> <code>485CE42FA2F023D30133C2484FCCF78D</code> <code>FC069B5A41022F7E2E2EB6D60DF8F6B2</code> <code>3464023AA6949C392D974AA960E178F6</code> <code>044931F032EBF8C0B53B01D450726FED</code> <code>E55564066EFFB2B1F82731DA90B8DC44</code><br> <code>F973E6BD</code></td>
<td><code>FE500200BF9868CC58EA651C43E6E897</code> <code>DAB48B908ADB0C0DC854E6A64F6F3EE6</code> <code>B6B03F7C9EEE4742EC00D53999AFB122</code> <code>CB051AB1EE7D7C0481277F1E967F95E6</code> <code>B7AA39CA0B4713047B2102FFB1EAE341</code> <code>536EFBC6822841DB3A9E6F4BB2FA3B7C</code> <code>1FA340198E53717C3111615E39B981B3</code> <code>D348C92840FB42E70C7EFF37F2C64ADB</code> <code>600A91BC7D2FA14383B2956967B5D211</code> <code>57E601D59EC502CAF7FFD443939B0FA4</code> <code>73C4FCC371ED6020D8F216996336BCED</code> <code>57EF4CAFD60D580166733E092A2A5028</code> <code>A34011ECE179DC96DFB1C6C4DF3B8B91</code> <code>E7255191BDA761759B2F5F80A651CBE7</code> <code>EC76EAA3642989DA5BC33F0EB3947C8F</code> <code>804F2E1916B2B181EDFAB7FE5CFD8ACF</code> <code>ECC188936334829C5EFCA58A586D7AC2</code> <code>818898F1C816ACCA3276BBFA08067BE6</code> <code>7A04726755B1D4C2017E63135C5CCF7B</code> <code>098A6A7E0AD52D096BEC4FB1D2A337CE</code> <code>325AC830553F515D32B150FC694A7A58</code> <code>A6331FF3564EF8C6CA311FDF57D29D4E</code> <code>D8E688F317713981B1E0154E390C7638</code> <code>2F59D628BE184ABCA7DE9A1E4550F2D7</code> <code>9B223C5220FA3BA48CF8E129B97F7421</code> <code>862C16655F135453366C7AB872F259FB</code> <code>1CDBA94AE197F52A5E45419473EC762B</code> <code>1EDCDF80641C60374C233CA6DE503C61</code> <code>6E117059FACA6FE9DFE18BEC5D03C9CE</code> <code>C349FB336620209922DA1A8EFCA5339E</code> <code>808D2A94CE77CEAA153B88D040958F14</code> <code>87C3574B312EDB98407062ABB4604762</code> <code>2ECB296B440BB00E083E44FF09B9C998</code> <code>E22ACECFC788DF082BF43016D12DDF9B</code> <code>6AC157294AD393EC940BB71D502B5C86</code> <code>E2DCED0F80A2B4A58AD95074A854A4D1</code> <code>3EC460278DA26719A6CC239431D80510</code><br> <code>F8372714</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = C1C01D642E4BC7F519FC61A4D33B649C753B77441903A159E7E7EA6B6
<!-- end server_DH_params_ok -->
<p>Decrypt <code>encrypted_answer</code> using the reverse of the process specified in <a href="/mtproto/auth_key#6-server-responds-with">step 6</a>:</p>
<!-- start server_DH_inner_data_input -->
<pre><code>encrypted_answer = 66D381F4675B7D308F41FB244EDB3689A8340447DB35BD190FB2E28AD3B0F6734AC8099D7DDBDA11AEE7CAFD5BAC7C3ACF7DBF4BE4443B822CE7046767AE39222F0B79021E7C4590CA22A94875B4930587F75A2F7786DA916E825977F84729AA8E0D1ACD94ABE7C3CBF213808F362E34832D4EBDEC44B239C245106410BF91CBD5DBB1A8C1D8B9D7DD4CD426B4B9F98693A4DD562F323C3F95CAD816884392361379552EA93EAEFAFA2AFB37C03A6F7C737DDFD09E601438897EBA18C7B73E98D9DB3152BA4443604C93C78474D3EA77610FCCB542AB099837D7AAAD63C2A4E08D05A2A85D9A31B9E2D4BB0ADE6271181B26F800626584426BB4E714C179DE8EC1B706C4C47A43DC2B6E29E8DD91D696FF05021C211175A49FA140EFBE10BF743E9CE258EC49C6198EF950B11A1B7CF2DDC5A49540AF6E3840109BE1FDF9554186B59ED37BE70FFB73AD88455BEEC8C26EE87E9F0CA7939E99491FAE134AB1451E1EC14ADA9727BC401335AC82FB5FAE55B80926F111D61E9D2A38045A91FC46BD85EACC65B6A0E2C2B4AAAFBEAA79DEF4FE10ECCF3E454039F88AB59BFAA6135C28B42D249D78FBEBD41E637DD38927A5EF81CF2795E2C13A75679CDB77C6F247743DC94DE74D9483449D8063FF24E91B803FA46263A7D1900DFEA98856403A9E9C76E91A003423184DEC1D117837936C29D9B7336CC4F76D42E029485CE42FA2F023D30133C2484FCCF78DFC069B5A41022F7E2E2EB6D60DF8F6B23464023AA6949C392D974AA960E178F6044931F032EBF8C0B53B01D450726FEDE55564066EFFB2B1F82731DA90B8DC44F973E6BD
tmp_aes_key = 3D27FBABF48F4AB792754710A5F63B0421105B1FCB1D6700FE2160586C3D6A5D
tmp_aes_iv = 5E37276CE40077CFCD38F6235E1BB0D2CAB73E21A6E0BF08892BABEF26DAC484</code></pre>
<pre><code>encrypted_answer = BF9868CC58EA651C43E6E897DAB48B908ADB0C0DC854E6A64F6F3EE6B6B03F7C9EEE4742EC00D53999AFB122CB051AB1EE7D7C0481277F1E967F95E6B7AA39CA0B4713047B2102FFB1EAE341536EFBC6822841DB3A9E6F4BB2FA3B7C1FA340198E53717C3111615E39B981B3D348C92840FB42E70C7EFF37F2C64ADB600A91BC7D2FA14383B2956967B5D21157E601D59EC502CAF7FFD443939B0FA473C4FCC371ED6020D8F216996336BCED57EF4CAFD60D580166733E092A2A5028A34011ECE179DC96DFB1C6C4DF3B8B91E7255191BDA761759B2F5F80A651CBE7EC76EAA3642989DA5BC33F0EB3947C8F804F2E1916B2B181EDFAB7FE5CFD8ACFECC188936334829C5EFCA58A586D7AC2818898F1C816ACCA3276BBFA08067BE67A04726755B1D4C2017E63135C5CCF7B098A6A7E0AD52D096BEC4FB1D2A337CE325AC830553F515D32B150FC694A7A58A6331FF3564EF8C6CA311FDF57D29D4ED8E688F317713981B1E0154E390C76382F59D628BE184ABCA7DE9A1E4550F2D79B223C5220FA3BA48CF8E129B97F7421862C16655F135453366C7AB872F259FB1CDBA94AE197F52A5E45419473EC762B1EDCDF80641C60374C233CA6DE503C616E117059FACA6FE9DFE18BEC5D03C9CEC349FB336620209922DA1A8EFCA5339E808D2A94CE77CEAA153B88D040958F1487C3574B312EDB98407062ABB46047622ECB296B440BB00E083E44FF09B9C998E22ACECFC788DF082BF43016D12DDF9B6AC157294AD393EC940BB71D502B5C86E2DCED0F80A2B4A58AD95074A854A4D13EC460278DA26719A6CC239431D80510F8372714
tmp_aes_key = F2737078BA87ACE9D32674419C3572A2B3A7C5F6F790E600908DAC9FBBF29580
tmp_aes_iv = 38814696B5CF75FCCEADE3023B9D912EAACCD73BBC507DD77D258887B2FFA00C</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 393A87194DCC3E35882E5BBE97CC9743826BA9B2BA0D89B5D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010006BF9BE57AB3FCF8F17D7D2F1136B62F73C4F918232B2A70D51EF194146111BB0C1B6C9EB8F01C304E96C12A2A23D30F02BBB6DB7431C2AF2111BAFB0BBF9A0F46315AA01F74691F1D6EC8126EF761DC18DE5CA3361489C5352E7FD57AA2978B65AC5EC7E1BD95D495B84F72DC88963C62C28AD871AB995CBA2F51F94E6AD7EF8721ABC5F1AE86EFE6AE9B584963FDFDAFB24F87A5780C6A0A5B2273C10C54B93F98E68219D01A8B58709943760C72F9B0C38528193613F55F2E08D8E1637A3EBA10EF58880E45584EDCD557CADDF1755AC695C14711AA5C0E76EDDC15E20D05463FF14D89EF2F4EA531E3B22F86DBD3B7FE893CD9A1A1DA8B712703E06925E555B35F658FF4853C209201EA
answer = BA0D89B5D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010006BF9BE57AB3FCF8F17D7D2F1136B62F73C4F918232B2A70D51EF194146111BB0C1B6C9EB8F01C304E96C12A2A23D30F02BBB6DB7431C2AF2111BAFB0BBF9A0F46315AA01F74691F1D6EC8126EF761DC18DE5CA3361489C5352E7FD57AA2978B65AC5EC7E1BD95D495B84F72DC88963C62C28AD871AB995CBA2F51F94E6AD7EF8721ABC5F1AE86EFE6AE9B584963FDFDAFB24F87A5780C6A0A5B2273C10C54B93F98E68219D01A8B58709943760C72F9B0C38528193613F55F2E08D8E1637A3EBA10EF58880E45584EDCD557CADDF1755AC695C14711AA5C0E76EDDC15E20D05463FF14D89EF2F4EA531E3B22F86DBD3B7FE893CD9A1A1DA8B712703E06925E555B35F658FF4853C209201EA</code></pre>
<pre><code>answer_with_hash = 21B7E150239A37E492A0B4AF380144B56D5BC9B6BA0D89B5C5C332D6450348059160C528281E97E0F3B9880B9B7511CAC6724DAAE4EE54A403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100A449D113F3616B4820D88D03B38E4382A9A75364F2B5039900A30D86C4A95D80532C295233B450D43599CFC8ABD70B103ABE5412CA3E463DAC83161556533739C4FE82AA33F76EA26A714E092181FEE07C20648B2BBC9F31DD963756269DF7172C588364928A8D9CAB44632A3349818BE81477867BBE7902DFDC89C45F823358ED2B897E1CDD3FFB44589FEF426ACEEBE7A17ABF83CE43051C116D04DB85EC7F48847BCA0813C947DFD4066CD98C023A43BA6A5985CACD7708C4F149605E789CCF658F45E44873CA06378A442844960045100C8D1A2B79C80D46ACA2D2892DC591BA09BC03169433C8FA40F3731FC0024AB1333F7FAD3C7E96703B1BBE56E19088BE5F65861247B07E135885
answer = BA0D89B5C5C332D6450348059160C528281E97E0F3B9880B9B7511CAC6724DAAE4EE54A403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100A449D113F3616B4820D88D03B38E4382A9A75364F2B5039900A30D86C4A95D80532C295233B450D43599CFC8ABD70B103ABE5412CA3E463DAC83161556533739C4FE82AA33F76EA26A714E092181FEE07C20648B2BBC9F31DD963756269DF7172C588364928A8D9CAB44632A3349818BE81477867BBE7902DFDC89C45F823358ED2B897E1CDD3FFB44589FEF426ACEEBE7A17ABF83CE43051C116D04DB85EC7F48847BCA0813C947DFD4066CD98C023A43BA6A5985CACD7708C4F149605E789CCF658F45E44873CA06378A442844960045100C8D1A2B79C80D46ACA2D2892DC591BA09BC03169433C8FA40F3731FC0024AB1333F7FAD3C7E96703B1BBE56E19088BE5F65861247B07E135885</code></pre>
<!-- end server_DH_inner_data_output -->
<!-- start server_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | BA 0D 89 B5 D3 C7 6C F7 7D 76 D6 35 46 A4 97 C0
0010 | 42 3D FC 7C 50 9F E3 CA 67 09 F9 B8 73 01 F3 45
0020 | D6 43 08 4B 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 C5 C3 32 D6 45 03 48 05 91 60 C5 28
0010 | 28 1E 97 E0 F3 B9 88 0B 9B 75 11 CA C6 72 4D AA
0020 | E4 EE 54 A4 03 00 00 00 FE 00 01 00 C7 1C AE B9
0030 | C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23
0040 | 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A
0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E
@ -532,23 +532,23 @@ answer = BA0D89B5D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084
0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6
0110 | 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0
0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00
0130 | 06 BF 9B E5 7A B3 FC F8 F1 7D 7D 2F 11 36 B6 2F
0140 | 73 C4 F9 18 23 2B 2A 70 D5 1E F1 94 14 61 11 BB
0150 | 0C 1B 6C 9E B8 F0 1C 30 4E 96 C1 2A 2A 23 D3 0F
0160 | 02 BB B6 DB 74 31 C2 AF 21 11 BA FB 0B BF 9A 0F
0170 | 46 31 5A A0 1F 74 69 1F 1D 6E C8 12 6E F7 61 DC
0180 | 18 DE 5C A3 36 14 89 C5 35 2E 7F D5 7A A2 97 8B
0190 | 65 AC 5E C7 E1 BD 95 D4 95 B8 4F 72 DC 88 96 3C
01A0 | 62 C2 8A D8 71 AB 99 5C BA 2F 51 F9 4E 6A D7 EF
01B0 | 87 21 AB C5 F1 AE 86 EF E6 AE 9B 58 49 63 FD FD
01C0 | AF B2 4F 87 A5 78 0C 6A 0A 5B 22 73 C1 0C 54 B9
01D0 | 3F 98 E6 82 19 D0 1A 8B 58 70 99 43 76 0C 72 F9
01E0 | B0 C3 85 28 19 36 13 F5 5F 2E 08 D8 E1 63 7A 3E
01F0 | BA 10 EF 58 88 0E 45 58 4E DC D5 57 CA DD F1 75
0200 | 5A C6 95 C1 47 11 AA 5C 0E 76 ED DC 15 E2 0D 05
0210 | 46 3F F1 4D 89 EF 2F 4E A5 31 E3 B2 2F 86 DB D3
0220 | B7 FE 89 3C D9 A1 A1 DA 8B 71 27 03 E0 69 25 E5
0230 | 55 B3 5F 65</code></pre>
0130 | A4 49 D1 13 F3 61 6B 48 20 D8 8D 03 B3 8E 43 82
0140 | A9 A7 53 64 F2 B5 03 99 00 A3 0D 86 C4 A9 5D 80
0150 | 53 2C 29 52 33 B4 50 D4 35 99 CF C8 AB D7 0B 10
0160 | 3A BE 54 12 CA 3E 46 3D AC 83 16 15 56 53 37 39
0170 | C4 FE 82 AA 33 F7 6E A2 6A 71 4E 09 21 81 FE E0
0180 | 7C 20 64 8B 2B BC 9F 31 DD 96 37 56 26 9D F7 17
0190 | 2C 58 83 64 92 8A 8D 9C AB 44 63 2A 33 49 81 8B
01A0 | E8 14 77 86 7B BE 79 02 DF DC 89 C4 5F 82 33 58
01B0 | ED 2B 89 7E 1C DD 3F FB 44 58 9F EF 42 6A CE EB
01C0 | E7 A1 7A BF 83 CE 43 05 1C 11 6D 04 DB 85 EC 7F
01D0 | 48 84 7B CA 08 13 C9 47 DF D4 06 6C D9 8C 02 3A
01E0 | 43 BA 6A 59 85 CA CD 77 08 C4 F1 49 60 5E 78 9C
01F0 | CF 65 8F 45 E4 48 73 CA 06 37 8A 44 28 44 96 00
0200 | 45 10 0C 8D 1A 2B 79 C8 0D 46 AC A2 D2 89 2D C5
0210 | 91 BA 09 BC 03 16 94 33 C8 FA 40 F3 73 1F C0 02
0220 | 4A B1 33 3F 7F AD 3C 7E 96 70 3B 1B BE 56 E1 90
0230 | 88 BE 5F 65</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
<table class="table">
@ -570,13 +570,13 @@ answer = BA0D89B5D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>509FE3CA6709F9B87301F345D643084B</code></td>
<td><code>F3B9880B9B7511CAC6724DAAE4EE54A4</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010006BF9BE57AB3FCF8F17D7D2F</code> <code>1136B62F73C4F918232B2A70D51EF194</code> <code>146111BB0C1B6C9EB8F01C304E96C12A</code> <code>2A23D30F02BBB6DB7431C2AF2111BAFB</code> <code>0BBF9A0F46315AA01F74691F1D6EC812</code> <code>6EF761DC18DE5CA3361489C5352E7FD5</code> <code>7AA2978B65AC5EC7E1BD95D495B84F72</code> <code>DC88963C62C28AD871AB995CBA2F51F9</code> <code>4E6AD7EF8721ABC5F1AE86EFE6AE9B58</code> <code>4963FDFDAFB24F87A5780C6A0A5B2273</code> <code>C10C54B93F98E68219D01A8B58709943</code> <code>760C72F9B0C38528193613F55F2E08D8</code> <code>E1637A3EBA10EF58880E45584EDCD557</code> <code>CADDF1755AC695C14711AA5C0E76EDDC</code> <code>15E20D05463FF14D89EF2F4EA531E3B2</code> <code>2F86DBD3B7FE893CD9A1A1DA8B712703</code><br> <code>E06925E5</code></td>
<td><code>FE000100A449D113F3616B4820D88D03</code> <code>B38E4382A9A75364F2B5039900A30D86</code> <code>C4A95D80532C295233B450D43599CFC8</code> <code>ABD70B103ABE5412CA3E463DAC831615</code> <code>56533739C4FE82AA33F76EA26A714E09</code> <code>2181FEE07C20648B2BBC9F31DD963756</code> <code>269DF7172C588364928A8D9CAB44632A</code> <code>3349818BE81477867BBE7902DFDC89C4</code> <code>5F823358ED2B897E1CDD3FFB44589FEF</code> <code>426ACEEBE7A17ABF83CE43051C116D04</code> <code>DB85EC7F48847BCA0813C947DFD4066C</code> <code>D98C023A43BA6A5985CACD7708C4F149</code> <code>605E789CCF658F45E44873CA06378A44</code> <code>2844960045100C8D1A2B79C80D46ACA2</code> <code>D2892DC591BA09BC03169433C8FA40F3</code> <code>731FC0024AB1333F7FAD3C7E96703B1B</code><br> <code>BE56E190</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>55B35F65</code> (1700770645 in decimal)</td>
<td><code>88BE5F65</code> (1700773512 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084
<h5><a class="anchor" href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" id="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" name="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message"><i class="anchor-icon"></i></a>7) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</h5>
<p>First, generate a secure random 2048-bit number b:</p>
<!-- start b -->
<pre><code>b = 64E2EF26A39DA1D134BFD62C4881C6600ABA06E681E481A21F6B9ECF59885EA9CBB9C82A124933495F18B5F74CA2CC395B9B52E81A2FCDEDB443EE445389587A87C2EED8B7D7A8028B8AB9578B0D11EBBC06AA404C3FCAA52EB20DA6DCF51415BC6C3010B2F03A968EADFFF7B51D4C52A21DA1A0A51B06372CAB3DBC72FD8707805F74FAB2E46A35CA38509312C7082C86470A72140C5221C19E99037B600243D8D84263EDB3096538788B74E9F447F4A4D1AF085B9F2AC39A4DF10D33D49663B6A02A66126D51801ABB27ED7421C78C2D6D23DA6530880F25BD752165B270F0CEEB4585B4DCE75B804E6928170D859C86460AC79320F3AD0E969FA9AC2694C7</code></pre>
<pre><code>b = 721D065348F636DA465FE81C841D97EAC3933560013243A109072ECBB45F509C002CE209BAF6EC962F619F2408518A5C18FA1BC72FC9198F935BFFEEC06CF4E31A5049095D41C0C7499CAF158FF435F51E52F161A66B28B161217475B24371537FC5156E17F109A91B8724BEFB0919A037E81366ADEEEB6F0E7A0377E87B5229D503B07A19CB5878C8456FCF7E5DE9AC5ACC21DF08283CD6A16F8C5227BC7D0806DEC16B5A96571D2B68677A17CFB9D23329D1895D49255544CB1539F7437171C3D7C68337C32BC663AAA62884E646E2F48A6BF63B5E85504C98B2A82D41AE567AEC7B2B6BBEA0BA718124C0806CC9BC7B0D29EE9F9F095DF79C9DBBD6CF4D11</code></pre>
<!-- end b -->
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
<!-- start g_b -->
<pre><code>g_b = 0101CD28945B9502B625E4B28EA75DE1E14906A131FBD5413560FE6EC87BEC6D633F1FF697108453542960A63EB30AE509DC57243D31585A7C17C5E399617701894EA6F8480A3102883D3CBA6C64B8C1A0278E70E3DB04B1F194B19115D3228C2EA6D913654E5E94B4238CF1E280D272920B001BC42DF938ADF07C190D6E8FECD564A28628F33F351245AB6A43F4A39CA1B47C1053C5D4A18B33B6EBC1E1698876A14E65C1963C277F4FCF8EEEA64A8BC97A725142EF37B8948B738494461443248699DC4F9FDFD0A8744D49AF7C42840DB9381F5D09DA3628EA002AEB7F32EBAF4FD275E7C6F8F99A37FA69FA321B30AF1AA988ABC5D9DFFCF97F221FD9172A</code></pre>
<pre><code>g_b = 7BA342F59ED8CA8BB4FC4030D95AF2AE8E07E4043241696228A22B379C93B838C9C40B0DC3DB2E36CEA32E86489CDCFC7133778B3A3C57FDA1A5A8668ECA1E15D8BF02AB2A6BBA47B7C444DEB10B8712744273DB722C9D09EDB938DFE85423788E615D06EB888D7B947ED95E26D1E631AF6DA1C244C7B90D6EA2F7C53E3D3A15CBD31169E00CA66587BDAEE6F50A24509DD1BF54073469D8AE233FF7A54540814936BEDB1F75627F32F26E06540765CFBB32D5EE85D2ACCF6F233882052CD068F1E8A8E419A3E3ADF17BF95F477F410F8A71C141539C47BEADD24C600B9319BA4590EF12CD5071FD6CE6627BAD38A6F1AC371CA30C9CE474F98903233D474282</code></pre>
<!-- end g_b -->
<h6>7.1) generation of encrypted_data</h6>
<!-- start client_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 54 B6 43 66 D3 C7 6C F7 7D 76 D6 35 46 A4 97 C0
0010 | 42 3D FC 7C 50 9F E3 CA 67 09 F9 B8 73 01 F3 45
0020 | D6 43 08 4B 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 01 01 CD 28 94 5B 95 02 B6 25 E4 B2 8E A7 5D E1
0040 | E1 49 06 A1 31 FB D5 41 35 60 FE 6E C8 7B EC 6D
0050 | 63 3F 1F F6 97 10 84 53 54 29 60 A6 3E B3 0A E5
0060 | 09 DC 57 24 3D 31 58 5A 7C 17 C5 E3 99 61 77 01
0070 | 89 4E A6 F8 48 0A 31 02 88 3D 3C BA 6C 64 B8 C1
0080 | A0 27 8E 70 E3 DB 04 B1 F1 94 B1 91 15 D3 22 8C
0090 | 2E A6 D9 13 65 4E 5E 94 B4 23 8C F1 E2 80 D2 72
00A0 | 92 0B 00 1B C4 2D F9 38 AD F0 7C 19 0D 6E 8F EC
00B0 | D5 64 A2 86 28 F3 3F 35 12 45 AB 6A 43 F4 A3 9C
00C0 | A1 B4 7C 10 53 C5 D4 A1 8B 33 B6 EB C1 E1 69 88
00D0 | 76 A1 4E 65 C1 96 3C 27 7F 4F CF 8E EE A6 4A 8B
00E0 | C9 7A 72 51 42 EF 37 B8 94 8B 73 84 94 46 14 43
00F0 | 24 86 99 DC 4F 9F DF D0 A8 74 4D 49 AF 7C 42 84
0100 | 0D B9 38 1F 5D 09 DA 36 28 EA 00 2A EB 7F 32 EB
0110 | AF 4F D2 75 E7 C6 F8 F9 9A 37 FA 69 FA 32 1B 30
0120 | AF 1A A9 88 AB C5 D9 DF FC F9 7F 22 1F D9 17 2A</code></pre>
<pre><code>0000 | 54 B6 43 66 C5 C3 32 D6 45 03 48 05 91 60 C5 28
0010 | 28 1E 97 E0 F3 B9 88 0B 9B 75 11 CA C6 72 4D AA
0020 | E4 EE 54 A4 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 7B A3 42 F5 9E D8 CA 8B B4 FC 40 30 D9 5A F2 AE
0040 | 8E 07 E4 04 32 41 69 62 28 A2 2B 37 9C 93 B8 38
0050 | C9 C4 0B 0D C3 DB 2E 36 CE A3 2E 86 48 9C DC FC
0060 | 71 33 77 8B 3A 3C 57 FD A1 A5 A8 66 8E CA 1E 15
0070 | D8 BF 02 AB 2A 6B BA 47 B7 C4 44 DE B1 0B 87 12
0080 | 74 42 73 DB 72 2C 9D 09 ED B9 38 DF E8 54 23 78
0090 | 8E 61 5D 06 EB 88 8D 7B 94 7E D9 5E 26 D1 E6 31
00A0 | AF 6D A1 C2 44 C7 B9 0D 6E A2 F7 C5 3E 3D 3A 15
00B0 | CB D3 11 69 E0 0C A6 65 87 BD AE E6 F5 0A 24 50
00C0 | 9D D1 BF 54 07 34 69 D8 AE 23 3F F7 A5 45 40 81
00D0 | 49 36 BE DB 1F 75 62 7F 32 F2 6E 06 54 07 65 CF
00E0 | BB 32 D5 EE 85 D2 AC CF 6F 23 38 82 05 2C D0 68
00F0 | F1 E8 A8 E4 19 A3 E3 AD F1 7B F9 5F 47 7F 41 0F
0100 | 8A 71 C1 41 53 9C 47 BE AD D2 4C 60 0B 93 19 BA
0110 | 45 90 EF 12 CD 50 71 FD 6C E6 62 7B AD 38 A6 F1
0120 | AC 37 1C A3 0C 9C E4 74 F9 89 03 23 3D 47 42 82</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;</code></pre>
<table class="table">
@ -658,19 +658,19 @@ answer = BA0D89B5D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>509FE3CA6709F9B87301F345D643084B</code></td>
<td><code>F3B9880B9B7511CAC6724DAAE4EE54A4</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001000101CD28945B9502B625E4B2</code> <code>8EA75DE1E14906A131FBD5413560FE6E</code> <code>C87BEC6D633F1FF697108453542960A6</code> <code>3EB30AE509DC57243D31585A7C17C5E3</code> <code>99617701894EA6F8480A3102883D3CBA</code> <code>6C64B8C1A0278E70E3DB04B1F194B191</code> <code>15D3228C2EA6D913654E5E94B4238CF1</code> <code>E280D272920B001BC42DF938ADF07C19</code> <code>0D6E8FECD564A28628F33F351245AB6A</code> <code>43F4A39CA1B47C1053C5D4A18B33B6EB</code> <code>C1E1698876A14E65C1963C277F4FCF8E</code> <code>EEA64A8BC97A725142EF37B8948B7384</code> <code>94461443248699DC4F9FDFD0A8744D49</code> <code>AF7C42840DB9381F5D09DA3628EA002A</code> <code>EB7F32EBAF4FD275E7C6F8F99A37FA69</code> <code>FA321B30AF1AA988ABC5D9DFFCF97F22</code><br> <code>1FD9172A</code></td>
<td><code>FE0001007BA342F59ED8CA8BB4FC4030</code> <code>D95AF2AE8E07E4043241696228A22B37</code> <code>9C93B838C9C40B0DC3DB2E36CEA32E86</code> <code>489CDCFC7133778B3A3C57FDA1A5A866</code> <code>8ECA1E15D8BF02AB2A6BBA47B7C444DE</code> <code>B10B8712744273DB722C9D09EDB938DF</code> <code>E85423788E615D06EB888D7B947ED95E</code> <code>26D1E631AF6DA1C244C7B90D6EA2F7C5</code> <code>3E3D3A15CBD31169E00CA66587BDAEE6</code> <code>F50A24509DD1BF54073469D8AE233FF7</code> <code>A54540814936BEDB1F75627F32F26E06</code> <code>540765CFBB32D5EE85D2ACCF6F233882</code> <code>052CD068F1E8A8E419A3E3ADF17BF95F</code> <code>477F410F8A71C141539C47BEADD24C60</code> <code>0B9319BA4590EF12CD5071FD6CE6627B</code> <code>AD38A6F1AC371CA30C9CE474F9890323</code><br> <code>3D474282</code></td>
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
</tr>
<tr>
@ -684,47 +684,47 @@ answer = BA0D89B5D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084
<!-- end client_DH_inner_data -->
<p>The serialization of <em>Client_DH_Inner_Data</em> produces a string <strong>data</strong>. This is used to generate <strong>encrypted_data</strong> as specified in <a href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message">step 6</a>, using the following inputs:</p>
<!-- start client_DH_inner_data_input -->
<pre><code>data = 54B64366D3C76CF77D76D63546A497C0423DFC7C509FE3CA6709F9B87301F345D643084B0000000000000000FE0001000101CD28945B9502B625E4B28EA75DE1E14906A131FBD5413560FE6EC87BEC6D633F1FF697108453542960A63EB30AE509DC57243D31585A7C17C5E399617701894EA6F8480A3102883D3CBA6C64B8C1A0278E70E3DB04B1F194B19115D3228C2EA6D913654E5E94B4238CF1E280D272920B001BC42DF938ADF07C190D6E8FECD564A28628F33F351245AB6A43F4A39CA1B47C1053C5D4A18B33B6EBC1E1698876A14E65C1963C277F4FCF8EEEA64A8BC97A725142EF37B8948B738494461443248699DC4F9FDFD0A8744D49AF7C42840DB9381F5D09DA3628EA002AEB7F32EBAF4FD275E7C6F8F99A37FA69FA321B30AF1AA988ABC5D9DFFCF97F221FD9172A
padding = 53EE4FD5B53345A7C4414441
tmp_aes_key = 3D27FBABF48F4AB792754710A5F63B0421105B1FCB1D6700FE2160586C3D6A5D
tmp_aes_iv = 5E37276CE40077CFCD38F6235E1BB0D2CAB73E21A6E0BF08892BABEF26DAC484</code></pre>
<pre><code>data = 54B64366C5C332D6450348059160C528281E97E0F3B9880B9B7511CAC6724DAAE4EE54A40000000000000000FE0001007BA342F59ED8CA8BB4FC4030D95AF2AE8E07E4043241696228A22B379C93B838C9C40B0DC3DB2E36CEA32E86489CDCFC7133778B3A3C57FDA1A5A8668ECA1E15D8BF02AB2A6BBA47B7C444DEB10B8712744273DB722C9D09EDB938DFE85423788E615D06EB888D7B947ED95E26D1E631AF6DA1C244C7B90D6EA2F7C53E3D3A15CBD31169E00CA66587BDAEE6F50A24509DD1BF54073469D8AE233FF7A54540814936BEDB1F75627F32F26E06540765CFBB32D5EE85D2ACCF6F233882052CD068F1E8A8E419A3E3ADF17BF95F477F410F8A71C141539C47BEADD24C600B9319BA4590EF12CD5071FD6CE6627BAD38A6F1AC371CA30C9CE474F98903233D474282
padding = EE89753DB02AF5E75F6C9CB4
tmp_aes_key = F2737078BA87ACE9D32674419C3572A2B3A7C5F6F790E600908DAC9FBBF29580
tmp_aes_iv = 38814696B5CF75FCCEADE3023B9D912EAACCD73BBC507DD77D258887B2FFA00C</code></pre>
<!-- end client_DH_inner_data_input -->
<p>Process:</p>
<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16)
encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre>
<p>Output:</p>
<!-- start client_DH_inner_data_output -->
<pre><code>encrypted_data = D87C822814EC5E1EB34E662573E9CD1D81E5610763754329FB82F1D3F26F190945E04FB3BE454EA6A7C45A68595D3368D0FE641D8F8EDA2B782745DAE87101473B4F17965547E0076AA6A8ACCFC9AB7989444DA3CE9864EDE9047B5A13C1DE5BC593B421494A2D286026C2E3E18197E31C2AE2DCC3D0AAA26501EDF471DF714EFB74E1484719CC4F2A41866755006A6CFEB75121ECD365129E5B5223C19A106059E064B6C8E0DF67EE9AB899F8FC91B743AD10E59763C2F2D3631EC8E330A3305B3339124B3393E99DEDC7ED864E953D706DBC4D8678145816E83EAFC5201872559C2FF7B873954DA23FFF48B91BD9ADA585C7546ABD5B2A9C64C3E415A763A5D632F0A2E20A01F0CEA280604BE1D03BF429463CE59ACE9D2F67F4823FFA5E581FB0C216D8CFABEE61ED86EF8920BA6B79ACDA6569EA73CDB07CB2F68B70E561CA641CC308239821350D567BF816C009</code></pre>
<pre><code>encrypted_data = 2C4629838C83FCE3A395DDE5CA4BC0F424201BAD2CF628564E7C78DECB7BBE27435041CC8092806BF2DA5E02788E9348D12D70774ADD08E96898D73536A75837F11A1D5E7E9FDCD58E7A2C9C19E0824F30398E9A03606332E861093594D155FD577916D84E25CF66D9BCD236989994B2EFA996F27245DC4CE535E42444E68A85120F9095045BD8AF4C7575B6556935917D28631EAEFDD09F5CE447BB4B881C37BF543B4188FA85D4155BE9F5DCC6C97FC97A817A62B2C19DFC649A7D74B368B14B04126B619DA1B798E7E5FB4CDF23BE631E9236341991923B1C9BEEA8584B6B52B3CD2626A58C419B7770C3EBA9EF52F75E461C35DA19FF68109FB5112B3F29A0DB43EE327F97232330A98424EE1A8644AEB1F142E05AD43882E3F200718A4F7D7ED2158714CF095D6677AFD4184D8972425DD47FBF17BD286A551BC21299970A308733A06CBADBD0FB05E393B07E3A</code></pre>
<!-- end client_DH_inner_data_output -->
<p>The length of the final string is 336 bytes.</p>
<h6>7.2) set_client_DH_params query</h6>
<!-- start set_client_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 80 E5 01 00 55 B3 5F 65
0010 | 78 01 00 00 1F 5F 04 F5 D3 C7 6C F7 7D 76 D6 35
0020 | 46 A4 97 C0 42 3D FC 7C 50 9F E3 CA 67 09 F9 B8
0030 | 73 01 F3 45 D6 43 08 4B FE 50 01 00 D8 7C 82 28
0040 | 14 EC 5E 1E B3 4E 66 25 73 E9 CD 1D 81 E5 61 07
0050 | 63 75 43 29 FB 82 F1 D3 F2 6F 19 09 45 E0 4F B3
0060 | BE 45 4E A6 A7 C4 5A 68 59 5D 33 68 D0 FE 64 1D
0070 | 8F 8E DA 2B 78 27 45 DA E8 71 01 47 3B 4F 17 96
0080 | 55 47 E0 07 6A A6 A8 AC CF C9 AB 79 89 44 4D A3
0090 | CE 98 64 ED E9 04 7B 5A 13 C1 DE 5B C5 93 B4 21
00A0 | 49 4A 2D 28 60 26 C2 E3 E1 81 97 E3 1C 2A E2 DC
00B0 | C3 D0 AA A2 65 01 ED F4 71 DF 71 4E FB 74 E1 48
00C0 | 47 19 CC 4F 2A 41 86 67 55 00 6A 6C FE B7 51 21
00D0 | EC D3 65 12 9E 5B 52 23 C1 9A 10 60 59 E0 64 B6
00E0 | C8 E0 DF 67 EE 9A B8 99 F8 FC 91 B7 43 AD 10 E5
00F0 | 97 63 C2 F2 D3 63 1E C8 E3 30 A3 30 5B 33 39 12
0100 | 4B 33 93 E9 9D ED C7 ED 86 4E 95 3D 70 6D BC 4D
0110 | 86 78 14 58 16 E8 3E AF C5 20 18 72 55 9C 2F F7
0120 | B8 73 95 4D A2 3F FF 48 B9 1B D9 AD A5 85 C7 54
0130 | 6A BD 5B 2A 9C 64 C3 E4 15 A7 63 A5 D6 32 F0 A2
0140 | E2 0A 01 F0 CE A2 80 60 4B E1 D0 3B F4 29 46 3C
0150 | E5 9A CE 9D 2F 67 F4 82 3F FA 5E 58 1F B0 C2 16
0160 | D8 CF AB EE 61 ED 86 EF 89 20 BA 6B 79 AC DA 65
0170 | 69 EA 73 CD B0 7C B2 F6 8B 70 E5 61 CA 64 1C C3
0180 | 08 23 98 21 35 0D 56 7B F8 16 C0 09</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 04 B6 0B 00 88 BE 5F 65
0010 | 78 01 00 00 1F 5F 04 F5 C5 C3 32 D6 45 03 48 05
0020 | 91 60 C5 28 28 1E 97 E0 F3 B9 88 0B 9B 75 11 CA
0030 | C6 72 4D AA E4 EE 54 A4 FE 50 01 00 2C 46 29 83
0040 | 8C 83 FC E3 A3 95 DD E5 CA 4B C0 F4 24 20 1B AD
0050 | 2C F6 28 56 4E 7C 78 DE CB 7B BE 27 43 50 41 CC
0060 | 80 92 80 6B F2 DA 5E 02 78 8E 93 48 D1 2D 70 77
0070 | 4A DD 08 E9 68 98 D7 35 36 A7 58 37 F1 1A 1D 5E
0080 | 7E 9F DC D5 8E 7A 2C 9C 19 E0 82 4F 30 39 8E 9A
0090 | 03 60 63 32 E8 61 09 35 94 D1 55 FD 57 79 16 D8
00A0 | 4E 25 CF 66 D9 BC D2 36 98 99 94 B2 EF A9 96 F2
00B0 | 72 45 DC 4C E5 35 E4 24 44 E6 8A 85 12 0F 90 95
00C0 | 04 5B D8 AF 4C 75 75 B6 55 69 35 91 7D 28 63 1E
00D0 | AE FD D0 9F 5C E4 47 BB 4B 88 1C 37 BF 54 3B 41
00E0 | 88 FA 85 D4 15 5B E9 F5 DC C6 C9 7F C9 7A 81 7A
00F0 | 62 B2 C1 9D FC 64 9A 7D 74 B3 68 B1 4B 04 12 6B
0100 | 61 9D A1 B7 98 E7 E5 FB 4C DF 23 BE 63 1E 92 36
0110 | 34 19 91 92 3B 1C 9B EE A8 58 4B 6B 52 B3 CD 26
0120 | 26 A5 8C 41 9B 77 70 C3 EB A9 EF 52 F7 5E 46 1C
0130 | 35 DA 19 FF 68 10 9F B5 11 2B 3F 29 A0 DB 43 EE
0140 | 32 7F 97 23 23 30 A9 84 24 EE 1A 86 44 AE B1 F1
0150 | 42 E0 5A D4 38 82 E3 F2 00 71 8A 4F 7D 7E D2 15
0160 | 87 14 CF 09 5D 66 77 AF D4 18 4D 89 72 42 5D D4
0170 | 7F BF 17 BD 28 6A 55 1B C2 12 99 97 0A 30 87 33
0180 | A0 6C BA DB D0 FB 05 E3 93 B0 7E 3A</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>80E5010055B35F65</code></td>
<td><code>04B60B0088BE5F65</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>509FE3CA6709F9B87301F345D643084B</code></td>
<td><code>F3B9880B9B7511CAC6724DAAE4EE54A4</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100D87C822814EC5E1EB34E6625</code> <code>73E9CD1D81E5610763754329FB82F1D3</code> <code>F26F190945E04FB3BE454EA6A7C45A68</code> <code>595D3368D0FE641D8F8EDA2B782745DA</code> <code>E87101473B4F17965547E0076AA6A8AC</code> <code>CFC9AB7989444DA3CE9864EDE9047B5A</code> <code>13C1DE5BC593B421494A2D286026C2E3</code> <code>E18197E31C2AE2DCC3D0AAA26501EDF4</code> <code>71DF714EFB74E1484719CC4F2A418667</code> <code>55006A6CFEB75121ECD365129E5B5223</code> <code>C19A106059E064B6C8E0DF67EE9AB899</code> <code>F8FC91B743AD10E59763C2F2D3631EC8</code> <code>E330A3305B3339124B3393E99DEDC7ED</code> <code>864E953D706DBC4D8678145816E83EAF</code> <code>C5201872559C2FF7B873954DA23FFF48</code> <code>B91BD9ADA585C7546ABD5B2A9C64C3E4</code> <code>15A763A5D632F0A2E20A01F0CEA28060</code> <code>4BE1D03BF429463CE59ACE9D2F67F482</code> <code>3FFA5E581FB0C216D8CFABEE61ED86EF</code> <code>8920BA6B79ACDA6569EA73CDB07CB2F6</code> <code>8B70E561CA641CC308239821350D567B</code><br> <code>F816C009</code></td>
<td><code>FE5001002C4629838C83FCE3A395DDE5</code> <code>CA4BC0F424201BAD2CF628564E7C78DE</code> <code>CB7BBE27435041CC8092806BF2DA5E02</code> <code>788E9348D12D70774ADD08E96898D735</code> <code>36A75837F11A1D5E7E9FDCD58E7A2C9C</code> <code>19E0824F30398E9A03606332E8610935</code> <code>94D155FD577916D84E25CF66D9BCD236</code> <code>989994B2EFA996F27245DC4CE535E424</code> <code>44E68A85120F9095045BD8AF4C7575B6</code> <code>556935917D28631EAEFDD09F5CE447BB</code> <code>4B881C37BF543B4188FA85D4155BE9F5</code> <code>DCC6C97FC97A817A62B2C19DFC649A7D</code> <code>74B368B14B04126B619DA1B798E7E5FB</code> <code>4CDF23BE631E9236341991923B1C9BEE</code> <code>A8584B6B52B3CD2626A58C419B7770C3</code> <code>EBA9EF52F75E461C35DA19FF68109FB5</code> <code>112B3F29A0DB43EE327F97232330A984</code> <code>24EE1A8644AEB1F142E05AD43882E3F2</code> <code>00718A4F7D7ED2158714CF095D6677AF</code> <code>D4184D8972425DD47FBF17BD286A551B</code> <code>C21299970A308733A06CBADBD0FB05E3</code><br> <code>93B07E3A</code></td>
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
</tr>
</tbody>
@ -785,17 +785,17 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<h5><a class="anchor" href="#8-auth-key-generation" id="8-auth-key-generation" name="8-auth-key-generation"><i class="anchor-icon"></i></a>8) Auth key generation</h5>
<p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p>
<!-- start auth_key -->
<pre><code>auth_key = 7CF9B59B3E589AD19732D8C6AC65E158087425B8292B8D9478CEE3A8DBEA0EEB7AAA241F99E0FF5B7AEE142B52C9884709FBCC7AC060DC5C9A650CEB1728884102B349E149425624A8FF289D891DAE6664661CF5CAE9598DD674533BB2FCD205EDF769CFBEA0718C47C7060D6E20BA996ED5A4157F0635EE0E75BD09C6D2393792E21DED2D3FC571F6E6CBE501DA25985185D58CE6BC67641A5771B6752F49BBCCDE3D50C39A292628A5D4FDFF95EF74343F7F00E78BD3DDC36F8F5650C27C2313F610D3F2667FF1471451159AC55D84B88C8BB571D1B9429F48448F551375E7BC8814DDEEE14A2C1CD10A8CEC3DB5CE854CEF9CAD8F25E0E0EC301146FE7915</code></pre>
<pre><code>auth_key = AB8DDCA57736451E442F957C8CBEC23975ECC1EE605411E92DE9BB856330DE4937E01E664A54B120BA31FA7934A0AB5032EAAF21D04090956BC515B589F4F23414CF820F83A77B830C7B041D9676EA24DAE2F283DCA0FF9E1118827EF98D04BDBD0830A708446CF2359B99A1ECA2A63B388F2FA72B87E368FA3B5EB7AD26A2597184C58023FAE8E83B9E56F489E982B598DE79C1FBAAFF6424E2B44D1174F3B3CD38540883B8BE868C0086D0F2CE7DFA2E7DD3C9D83B552A10160CDB94040B99827731A15B33A8E94EB9BAC180CAD38CA5FF20910A6BB67813D7C794EB6439F20B78245613D3C320647C1708CFE46E4CA4736CC74ED66C96A158905FF78B54F3</code></pre>
<!-- end auth_key -->
<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5>
<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p>
<!-- start dh_gen_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A0 54 0A 56 B3 5F 65
0010 | 48 00 00 00 34 F7 CB 3B D3 C7 6C F7 7D 76 D6 35
0020 | 46 A4 97 C0 42 3D FC 7C 50 9F E3 CA 67 09 F9 B8
0030 | 73 01 F3 45 D6 43 08 4B 3C D0 2A AE BA DA C1 B2
0040 | 14 02 56 C9 BF F8 13 05</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D4 11 02 89 BE 5F 65
0010 | 90 00 00 00 34 F7 CB 3B C5 C3 32 D6 45 03 48 05
0020 | 91 60 C5 28 28 1E 97 E0 F3 B9 88 0B 9B 75 11 CA
0030 | C6 72 4D AA E4 EE 54 A4 8F A4 DA 70 B7 40 2D 13
0040 | A0 38 93 04 0E FC 1A F8</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01A0540A56B35F65</code></td>
<td><code>01D4110289BE5F65</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>48000000</code> (72 in decimal)</td>
<td><code>90000000</code> (144 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>D3C76CF77D76D63546A497C0423DFC7C</code></td>
<td><code>C5C332D6450348059160C528281E97E0</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>509FE3CA6709F9B87301F345D643084B</code></td>
<td><code>F3B9880B9B7511CAC6724DAAE4EE54A4</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>3CD02AAEBADAC1B2140256C9BFF81305</code></td>
<td><code>8FA4DA70B7402D13A03893040EFC1AF8</code></td>
<td>The 128 lower-order bits of SHA1 of the byte string derived from the <code>new_nonce</code> string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with <code>auth_key_aux_hash</code>. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</td>
</tr>
</tbody>

View file

@ -841,7 +841,7 @@
</tr>
<tr>
<td><a href="/method/bots.canSendMessage">bots.canSendMessage</a></td>
<td> </td>
<td>Check whether the specified bot can send us messages</td>
</tr>
<tr>
<td><a href="/method/stories.togglePeerStoriesHidden">stories.togglePeerStoriesHidden</a></td>

View file

@ -97,7 +97,7 @@
</tr>
<tr>
<td><a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a></td>
<td> </td>
<td>Send a custom request from a <a href="/api/bots/webapps">mini bot app</a></td>
</tr>
</tbody>
</table></div>

View file

@ -582,7 +582,7 @@
</tr>
<tr>
<td><a href="/method/bots.allowSendMessage">bots.allowSendMessage</a></td>
<td> </td>
<td>Allow the specified bot to send us messages</td>
</tr>
<tr>
<td><a href="/method/stories.getAllReadPeerStories">stories.getAllReadPeerStories</a></td>