Update content of files

This commit is contained in:
GitHub Action 2024-07-17 17:26:01 +00:00
parent 14f301cfd3
commit df39c2ac45
6 changed files with 382 additions and 230 deletions

View file

@ -0,0 +1,142 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Fact-checks</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram clients support displaying fact-checks added to messages by independent fact-checkers.">
<meta property="og:title" content="Fact-checks">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram clients support displaying fact-checks added to messages by independent fact-checkers.">
<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">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?239" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<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="/api/factcheck" >Fact-checks</a></li></ul></div>
<h1 id="dev_page_title">Fact-checks</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Telegram clients support displaying fact-checks added to messages by independent fact-checkers.</p>
<h3><a class="anchor" href="#displaying-fact-checks" id="displaying-fact-checks" name="displaying-fact-checks"><i class="anchor-icon"></i></a>Displaying fact-checks</h3>
<pre><code><a href='/constructor/factCheck'>factCheck</a>#b89bfccf flags:<a href='/type/%23'>#</a> need_check:flags.0?<a href='/constructor/true'>true</a> country:flags.1?<a href='/type/string'>string</a> text:flags.1?<a href='/type/TextWithEntities'>TextWithEntities</a> hash:<a href='/type/long'>long</a> = <a href='/type/FactCheck'>FactCheck</a>;
<a href='/constructor/message'>message</a>#94345242 flags:<a href='/type/%23'>#</a> out:flags.1?<a href='/constructor/true'>true</a> mentioned:flags.4?<a href='/constructor/true'>true</a> media_unread:flags.5?<a href='/constructor/true'>true</a> silent:flags.13?<a href='/constructor/true'>true</a> post:flags.14?<a href='/constructor/true'>true</a> from_scheduled:flags.18?<a href='/constructor/true'>true</a> legacy:flags.19?<a href='/constructor/true'>true</a> edit_hide:flags.21?<a href='/constructor/true'>true</a> pinned:flags.24?<a href='/constructor/true'>true</a> noforwards:flags.26?<a href='/constructor/true'>true</a> invert_media:flags.27?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> offline:flags2.1?<a href='/constructor/true'>true</a> id:<a href='/type/int'>int</a> from_id:flags.8?<a href='/type/Peer'>Peer</a> from_boosts_applied:flags.29?<a href='/type/int'>int</a> peer_id:<a href='/type/Peer'>Peer</a> saved_peer_id:flags.28?<a href='/type/Peer'>Peer</a> fwd_from:flags.2?<a href='/type/MessageFwdHeader'>MessageFwdHeader</a> via_bot_id:flags.11?<a href='/type/long'>long</a> via_business_bot_id:flags2.0?<a href='/type/long'>long</a> reply_to:flags.3?<a href='/type/MessageReplyHeader'>MessageReplyHeader</a> date:<a href='/type/int'>int</a> message:<a href='/type/string'>string</a> media:flags.9?<a href='/type/MessageMedia'>MessageMedia</a> reply_markup:flags.6?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.7?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; views:flags.10?<a href='/type/int'>int</a> forwards:flags.10?<a href='/type/int'>int</a> replies:flags.23?<a href='/type/MessageReplies'>MessageReplies</a> edit_date:flags.15?<a href='/type/int'>int</a> post_author:flags.16?<a href='/type/string'>string</a> grouped_id:flags.17?<a href='/type/long'>long</a> reactions:flags.20?<a href='/type/MessageReactions'>MessageReactions</a> restriction_reason:flags.22?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; ttl_period:flags.25?<a href='/type/int'>int</a> quick_reply_shortcut_id:flags.30?<a href='/type/int'>int</a> effect:flags2.2?<a href='/type/long'>long</a> factcheck:flags2.3?<a href='/type/FactCheck'>FactCheck</a> = <a href='/type/Message'>Message</a>;
---functions---
<a href='/method/messages.getFactCheck'>messages.getFactCheck</a>#b9cdc5ee peer:<a href='/type/InputPeer'>InputPeer</a> msg_id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/FactCheck'>FactCheck</a>&gt;;</code></pre>
<p>Fact-checks are represented by <a href="/constructor/factCheck">factCheck</a> constructors, optionally contained in the <code>factcheck</code> field of the <a href="/constructor/message">message</a> constructor. </p>
<h3><a class="anchor" href="#editing-fact-checks" id="editing-fact-checks" name="editing-fact-checks"><i class="anchor-icon"></i></a>Editing fact-checks</h3>
<pre><code><a href='/constructor/factCheck'>factCheck</a>#b89bfccf flags:<a href='/type/%23'>#</a> need_check:flags.0?<a href='/constructor/true'>true</a> country:flags.1?<a href='/type/string'>string</a> text:flags.1?<a href='/type/TextWithEntities'>TextWithEntities</a> hash:<a href='/type/long'>long</a> = <a href='/type/FactCheck'>FactCheck</a>;
---functions---
<a href='/method/messages.editFactCheck'>messages.editFactCheck</a>#0589ee75 peer:<a href='/type/InputPeer'>InputPeer</a> msg_id:<a href='/type/int'>int</a> text:<a href='/type/TextWithEntities'>TextWithEntities</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.deleteFactCheck'>messages.deleteFactCheck</a>#d1da940c peer:<a href='/type/InputPeer'>InputPeer</a> msg_id:<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Fact-checks may be created, deleted and edited by independent fact-checkers using <a href="/method/messages.editFactCheck">messages.editFactCheck</a> and <a href="/method/messages.deleteFactCheck">messages.deleteFactCheck</a>. </p>
<p>Those methods can be used by independent fact-checkers, which will have the <a href="/api/config#can-edit-factcheck">appConfig.can_edit_factcheck</a> configuration flag set to <code>true</code>. </p>
<p>If the flag mentioned above is set to <code>true</code>, the maximum UTF-8 length for a fact check will be specified in the <a href="/api/config#factcheck-length-limit">appConfig.factcheck_length_limit</a> field.</p></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/privacy">Privacy</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/android">Android</a></li>
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/press">Press</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -123,7 +123,17 @@
<a href='/method/account.getGlobalPrivacySettings'>account.getGlobalPrivacySettings</a>#eb2b4cf6 = <a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a>; <a href='/method/account.getGlobalPrivacySettings'>account.getGlobalPrivacySettings</a>#eb2b4cf6 = <a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a>;
<a href='/method/account.setGlobalPrivacySettings'>account.setGlobalPrivacySettings</a>#1edaaac2 settings:<a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a> = <a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a>;</code></pre> <a href='/method/account.setGlobalPrivacySettings'>account.setGlobalPrivacySettings</a>#1edaaac2 settings:<a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a> = <a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a>;</code></pre>
<p>Some global privacy settings can also be fetched and modified using <a href="/method/account.getGlobalPrivacySettings">account.getGlobalPrivacySettings</a> and <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>. </p> <p>Some global privacy settings can also be fetched and modified using <a href="/method/account.getGlobalPrivacySettings">account.getGlobalPrivacySettings</a> and <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>. </p>
<p>Global privacy settings are represented by the <a href="/constructor/globalPrivacySettings">globalPrivacySettings</a> constructor, please see the <a href="/constructor/globalPrivacySettings">constructor page</a> for a full description of all settings.</p></div> <p>Global privacy settings are represented by the <a href="/constructor/globalPrivacySettings">globalPrivacySettings</a> constructor, please see the <a href="/constructor/globalPrivacySettings">constructor page</a> for a full description of all settings.</p>
<h4><a class="anchor" href="#require-premium-for-new-non-contact-users" id="require-premium-for-new-non-contact-users" name="require-premium-for-new-non-contact-users"><i class="anchor-icon"></i></a>Require Premium for new non-contact users</h4>
<pre><code><a href='/constructor/userFull'>userFull</a>#cc997720 flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> phone_calls_available:flags.4?<a href='/constructor/true'>true</a> phone_calls_private:flags.5?<a href='/constructor/true'>true</a> can_pin_message:flags.7?<a href='/constructor/true'>true</a> has_scheduled:flags.12?<a href='/constructor/true'>true</a> video_calls_available:flags.13?<a href='/constructor/true'>true</a> voice_messages_forbidden:flags.20?<a href='/constructor/true'>true</a> translations_disabled:flags.23?<a href='/constructor/true'>true</a> stories_pinned_available:flags.26?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.27?<a href='/constructor/true'>true</a> wallpaper_overridden:flags.28?<a href='/constructor/true'>true</a> contact_require_premium:flags.29?<a href='/constructor/true'>true</a> read_dates_private:flags.30?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> sponsored_enabled:flags2.7?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> personal_photo:flags.21?<a href='/type/Photo'>Photo</a> profile_photo:flags.2?<a href='/type/Photo'>Photo</a> fallback_photo:flags.22?<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> bot_info:flags.3?<a href='/type/BotInfo'>BotInfo</a> pinned_msg_id:flags.6?<a href='/type/int'>int</a> common_chats_count:<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> ttl_period:flags.14?<a href='/type/int'>int</a> theme_emoticon:flags.15?<a href='/type/string'>string</a> private_forward_name:flags.16?<a href='/type/string'>string</a> bot_group_admin_rights:flags.17?<a href='/type/ChatAdminRights'>ChatAdminRights</a> bot_broadcast_admin_rights:flags.18?<a href='/type/ChatAdminRights'>ChatAdminRights</a> premium_gifts:flags.19?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PremiumGiftOption'>PremiumGiftOption</a>&gt; wallpaper:flags.24?<a href='/type/WallPaper'>WallPaper</a> stories:flags.25?<a href='/type/PeerStories'>PeerStories</a> business_work_hours:flags2.0?<a href='/type/BusinessWorkHours'>BusinessWorkHours</a> business_location:flags2.1?<a href='/type/BusinessLocation'>BusinessLocation</a> business_greeting_message:flags2.2?<a href='/type/BusinessGreetingMessage'>BusinessGreetingMessage</a> business_away_message:flags2.3?<a href='/type/BusinessAwayMessage'>BusinessAwayMessage</a> business_intro:flags2.4?<a href='/type/BusinessIntro'>BusinessIntro</a> birthday:flags2.5?<a href='/type/Birthday'>Birthday</a> personal_channel_id:flags2.6?<a href='/type/long'>long</a> personal_channel_message:flags2.6?<a href='/type/int'>int</a> = <a href='/type/UserFull'>UserFull</a>;
---functions---
<a href='/method/users.getIsPremiumRequiredToContact'>users.getIsPremiumRequiredToContact</a>#a622aa10 id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Bool'>Bool</a>&gt;;</code></pre>
<p>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code>, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private.</p>
<p>To easily check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <a href="/constructor/userFull">userFull</a> or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user.</p>
<p>This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.</p>
<p>Note that this method should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, only for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</p></div>
</div> </div>

View file

@ -4,24 +4,26 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>updateSmsJob</title> <title>updateSmsJob</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters <meta property="description" content="A new SMS job was received
Parameters
Name Name
Type Type
Description Description
job_id job_id
string string
  SMS job ID
Type Type
Update"> Update">
<meta property="og:title" content="updateSmsJob"> <meta property="og:title" content="updateSmsJob">
<meta property="og:image" content=""> <meta property="og:image" content="">
<meta property="og:description" content="Parameters <meta property="og:description" content="A new SMS job was received
Parameters
Name Name
Type Type
Description Description
job_id job_id
string string
  SMS job ID
Type Type
Update"> Update">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4"> <link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
@ -58,7 +60,8 @@ Update">
<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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/updateSmsJob" >updateSmsJob</a></li></ul></div> <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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/updateSmsJob" >updateSmsJob</a></li></ul></div>
<h1 id="dev_page_title">updateSmsJob</h1> <h1 id="dev_page_title">updateSmsJob</h1>
<div id="dev_page_content"><p><div class="clearfix"> <div id="dev_page_content"><p>A new SMS job was received</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills"> <ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 181 <b class="caret"></b></a> <a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 181 <b class="caret"></b></a>
@ -84,7 +87,7 @@ Update">
<tr> <tr>
<td><strong>job_id</strong></td> <td><strong>job_id</strong></td>
<td style="text-align: center;"><a href="/type/string">string</a></td> <td style="text-align: center;"><a href="/type/string">string</a></td>
<td> </td> <td>SMS job ID</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -4,26 +4,26 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>updateStarsBalance</title> <title>updateStarsBalance</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters <meta property="description" content="The current account&#39;s Telegram Stars balance » has changed.
Parameters
Name Name
Type Type
Description Description
balance balance
long long
  New balance.
Type Type…">
Update">
<meta property="og:title" content="updateStarsBalance"> <meta property="og:title" content="updateStarsBalance">
<meta property="og:image" content=""> <meta property="og:image" content="">
<meta property="og:description" content="Parameters <meta property="og:description" content="The current account&#39;s Telegram Stars balance » has changed.
Parameters
Name Name
Type Type
Description Description
balance balance
long long
  New balance.
Type Type…">
Update">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4"> <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="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -58,7 +58,8 @@ Update">
<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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/updateStarsBalance" >updateStarsBalance</a></li></ul></div> <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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/updateStarsBalance" >updateStarsBalance</a></li></ul></div>
<h1 id="dev_page_title">updateStarsBalance</h1> <h1 id="dev_page_title">updateStarsBalance</h1>
<div id="dev_page_content"><p><div class="clearfix"> <div id="dev_page_content"><p>The current account's <a href="/api/stars">Telegram Stars balance »</a> has changed.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills"> <ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 181 <b class="caret"></b></a> <a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 181 <b class="caret"></b></a>
@ -84,7 +85,7 @@ Update">
<tr> <tr>
<td><strong>balance</strong></td> <td><strong>balance</strong></td>
<td style="text-align: center;"><a href="/type/long">long</a></td> <td style="text-align: center;"><a href="/type/long">long</a></td>
<td> </td> <td>New balance.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>users.getIsPremiumRequiredToContact</title> <title>users.getIsPremiumRequiredToContact</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Check whether we can write to the specified user (non-Premium users only). If a user enables their new_noncontact_peers_require_premium global privacy setting, represented in userFull.contact_require_premium, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private. To easily check whether we can write to a user with this flag enabled, if we haven&#39;t yet cached all the required information (for example we don&#39;t have the userFull or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a Premium subscription. Note that this method should only be invoked if we don&#39;t have a Premium subscription, for users whose full info (userFull + message history information + contact information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual updates."> <meta property="description" content="Check whether we can write to the specified user (non-Premium users only). If a user enables their new_noncontact_peers_require_premium global privacy setting, represented in userFull.contact_require_premium, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private. To easily check whether we can write to a user with this flag enabled, if we haven&#39;t yet cached all the required information (for example we don&#39;t have the userFull or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a Premium subscription. Note that this method should only be invoked if we don&#39;t have a Premium subscription, only for users whose full info (userFull + message history information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual updates.">
<meta property="og:title" content="users.getIsPremiumRequiredToContact"> <meta property="og:title" content="users.getIsPremiumRequiredToContact">
<meta property="og:image" content=""> <meta property="og:image" content="">
<meta property="og:description" content="Check whether we can write to the specified user (non-Premium users only). If a user enables their new_noncontact_peers_require_premium global privacy setting, represented in userFull.contact_require_premium, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private. To easily check whether we can write to a user with this flag enabled, if we haven&#39;t yet cached all the required information (for example we don&#39;t have the userFull or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a Premium subscription. Note that this method should only be invoked if we don&#39;t have a Premium subscription, for users whose full info (userFull + message history information + contact information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual updates."> <meta property="og:description" content="Check whether we can write to the specified user (non-Premium users only). If a user enables their new_noncontact_peers_require_premium global privacy setting, represented in userFull.contact_require_premium, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private. To easily check whether we can write to a user with this flag enabled, if we haven&#39;t yet cached all the required information (for example we don&#39;t have the userFull or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user. This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a Premium subscription. Note that this method should only be invoked if we don&#39;t have a Premium subscription, only for users whose full info (userFull + message history information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual updates.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4"> <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="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -42,11 +42,7 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/users.getIsPremiumRequiredToContact" >users.getIsPremiumRequiredToContact</a></li></ul></div> <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/users.getIsPremiumRequiredToContact" >users.getIsPremiumRequiredToContact</a></li></ul></div>
<h1 id="dev_page_title">users.getIsPremiumRequiredToContact</h1> <h1 id="dev_page_title">users.getIsPremiumRequiredToContact</h1>
<div id="dev_page_content"><p>Check whether we can write to the specified user (non-<a href="/api/premium">Premium</a> users only).</p> <div id="dev_page_content"><p>Check whether we can write to the specified user (non-<a href="/api/premium">Premium</a> users only), see <a href="/api/privacy#require-premium-for-new-non-contact-users">here »</a> for more info on the full flow.</p>
<p>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code>, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private.</p>
<p>To easily check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <a href="/constructor/userFull">userFull</a> or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user.</p>
<p>This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.</p>
<p>Note that this method should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, only for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</p>
<p><div class="clearfix"> <p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills"> <ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown"> <li class="dropdown">

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 C4 8A 04 00 89 FB 97 66 <pre><code>0000 | 00 00 00 00 00 00 00 00 78 1B 0B 00 BA FB 97 66
0010 | 14 00 00 00 F1 8E 7E BE AE 3C 4B 5C 6F 3C 2B 0D 0010 | 14 00 00 00 F1 8E 7E BE 9B DE 3C 06 C0 EF 93 D9
0020 | 7D 27 2F 73 3E 43 D7 16</code></pre> 0020 | 72 AF 72 00 A0 EA F5 AB</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>C48A040089FB9766</code></td> <td><code>781B0B00BAFB9766</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>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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 A8 12 6E 89 FB 97 66 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 10 15 25 BA FB 97 66
0010 | 50 00 00 00 63 24 16 05 AE 3C 4B 5C 6F 3C 2B 0D 0010 | 5C 00 00 00 63 24 16 05 9B DE 3C 06 C0 EF 93 D9
0020 | 7D 27 2F 73 3E 43 D7 16 2F C9 7B B4 A7 29 4A 97 0020 | 72 AF 72 00 A0 EA F5 AB BD 90 9B 93 BE F0 96 1A
0030 | 8D 22 18 F0 39 EC B2 86 08 1F 24 6C E9 AB 05 AB 0030 | 95 C6 37 5A D6 CF 6E B5 08 29 80 17 E1 62 0E 71
0040 | AD 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09 0040 | 83 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>01A8126E89FB9766</code></td> <td><code>01101525BAFB9766</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>50000000</code> (80 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>
@ -150,19 +150,19 @@
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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>2FC97BB4A7294A978D2218F039ECB286</code></td> <td><code>BD909B93BEF0961A95C6375AD6CF6EB5</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>081F246CE9AB05ABAD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2244038265189804973</td> <td><code>08298017E1620E7183000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2990416409354203523</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-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> <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 --> <!-- start pq -->
<pre><code>pq = 2244038265189804973</code></pre> <pre><code>pq = 2990416409354203523</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2244038265189804973 = 1408624999 * 1593070027</code></p> <p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2990416409354203523 = 1614906899 * 1851757777</code></p>
<pre><code>p = 1408624999 <pre><code>p = 1614906899
q = 1593070027</code></pre> q = 1851757777</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 1F 24 6C E9 AB 05 AB AD 00 00 00 <pre><code>0000 | 95 5F F5 A9 08 29 80 17 E1 62 0E 71 83 00 00 00
0010 | 04 53 F5 E9 67 00 00 00 04 5E F4 51 CB 00 00 00 0010 | 04 60 41 86 13 00 00 00 04 6E 5F 94 D1 00 00 00
0020 | AE 3C 4B 5C 6F 3C 2B 0D 7D 27 2F 73 3E 43 D7 16 0020 | 9B DE 3C 06 C0 EF 93 D9 72 AF 72 00 A0 EA F5 AB
0030 | 2F C9 7B B4 A7 29 4A 97 8D 22 18 F0 39 EC B2 86 0030 | BD 90 9B 93 BE F0 96 1A 95 C6 37 5A D6 CF 6E B5
0040 | 93 1C 01 18 53 0C 27 7A 4A 14 D0 9A 0D 66 69 83 0040 | 4D 3E 1A 6F 33 4E 05 CB BD 96 87 28 CB 0A 0D 78
0050 | 5D 59 2B F0 82 D8 38 FC 0D DA B1 AD 31 6B 2B E0 0050 | 2D F2 3F 59 F9 2F 34 3F 05 BC 15 A2 EC F1 3F 86
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 = 1593070027</code></pre>
<tr> <tr>
<td>pq</td> <td>pq</td>
<td>4, 12</td> <td>4, 12</td>
<td><code>081F246CE9AB05ABAD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2244038265189804973</td> <td><code>08298017E1620E7183000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2990416409354203523</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>0453F5E967000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1408624999</td> <td><code>0460418613000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1614906899</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>045EF451CB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1593070027</td> <td><code>046E5F94D1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1851757777</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>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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>2FC97BB4A7294A978D2218F039ECB286</code></td> <td><code>BD909B93BEF0961A95C6375AD6CF6EB5</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>931C0118530C277A4A14D09A0D666983</code> <code>5D592BF082D838FC0DDAB1AD316B2BE0</code></td> <td><code>4D3E1A6F334E05CBBD968728CB0A0D78</code> <code>2DF23F59F92F343F05BC15A2ECF13F86</code></td>
<td>Client-generated random number</td> <td>Client-generated random number</td>
</tr> </tr>
<tr> <tr>
@ -291,39 +291,39 @@ q = 1593070027</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 = 955FF5A9081F246CE9AB05ABAD0000000453F5E967000000045EF451CB000000AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB286931C0118530C277A4A14D09A0D6669835D592BF082D838FC0DDAB1AD316B2BE002000000 <pre><code>data = 955FF5A908298017E1620E71830000000460418613000000046E5F94D10000009BDE3C06C0EF93D972AF7200A0EAF5ABBD909B93BEF0961A95C6375AD6CF6EB54D3E1A6F334E05CBBD968728CB0A0D782DF23F59F92F343F05BC15A2ECF13F8602000000
random_padding_bytes = 0E2699DFACC1B6A2D082AEBE8C63650321BB14AFE76B6E0DDF2A8A6FF534715475D1FEEC91ABC1847BAF02BA2A7E295CAB7CDB9494C9B1A55786AC1C0E83C2720F31235532F031D936F410385637604AF66C25A4C3A4CE36169DA894</code></pre> random_padding_bytes = 27B8093BC146B3FE1222F8910D5FAA0866D2831ACD45B8C999F2A99548B1E99F041DCBD5DE28FCF848638ACF52A5CA9B2AF049FDBD923F7768AB3B0473CF774B8D9230A3EDA3A93944AC7ED34B3CD15F908120D455D9FE2CB7B103F6</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 = 309798B07DE64CAE6DB0111C1848BD936E2C4B2BD3A17401E5448A3560E72351D6BB5F7B2D753BECDC02DA804836B60307BA45CABE17AA38C914FCA05E87F2F7C00DDA86279AEEE0A00F0740EB88863EBD2B879472A5343935727285386819EE48012412A86766EEE54EE94A480DAF5D6C66777DC8F1F61F149498088E4CFFD972317F2F50A5ADF76596B302C56F5877061817C0FBC15E852F35C673A6658DA12053DDDD65297FE6F9F31A9699BD50861FF88CBBC0B37FF3F4CCBA3DB67A260F31DB113AE141D824DA0F62519BD2448878CEDA3A7B207C42E35762D6D252E00DAE36643972C4EE59FC919DF55F14CF8FAA2F9214FE4687FD5C058F7D7E832D09</code></pre> <pre><code>encrypted_data = 7179356E012AA6DEEB3C68B44AB1212A369EBAA91FCFD005C39F7D132A211B80658041625047A44296E9E4103C286B9E29377870DEB364F9C741835B6002FF284163782C380F7D8D5424B12030626CA59AE9D59F8B8B6A9FDC6E4F56B25CDFB3E6DD942D9467A252A288D9427A14D176498F8E275050E3D94571BB91805154491A938EC2251CC9DC264216BAD171583C94DE1D666AFE7CBACEC319F60E1307B73311EB870D821CC20613BEDC745145F8EBCF4DC430284A05B9FA1EA8A0700C336C85A74BF87484538F3D5ADF6D534E06893577DB1E8C4F0BB4D2EB4A4404EA5EE27FB86457945F2BF42016BDAEF803411C43C0F06339B90D7D2841B3C5C37412</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 EC B6 0B 00 89 FB 97 66 <pre><code>0000 | 00 00 00 00 00 00 00 00 7C 1B 0B 00 BA FB 97 66
0010 | 40 01 00 00 BE E4 12 D7 AE 3C 4B 5C 6F 3C 2B 0D 0010 | 40 01 00 00 BE E4 12 D7 9B DE 3C 06 C0 EF 93 D9
0020 | 7D 27 2F 73 3E 43 D7 16 2F C9 7B B4 A7 29 4A 97 0020 | 72 AF 72 00 A0 EA F5 AB BD 90 9B 93 BE F0 96 1A
0030 | 8D 22 18 F0 39 EC B2 86 04 53 F5 E9 67 00 00 00 0030 | 95 C6 37 5A D6 CF 6E B5 04 60 41 86 13 00 00 00
0040 | 04 5E F4 51 CB 00 00 00 85 FD 64 DE 85 1D 9D D0 0040 | 04 6E 5F 94 D1 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 30 97 98 B0 7D E6 4C AE 6D B0 11 1C 0050 | FE 00 01 00 71 79 35 6E 01 2A A6 DE EB 3C 68 B4
0060 | 18 48 BD 93 6E 2C 4B 2B D3 A1 74 01 E5 44 8A 35 0060 | 4A B1 21 2A 36 9E BA A9 1F CF D0 05 C3 9F 7D 13
0070 | 60 E7 23 51 D6 BB 5F 7B 2D 75 3B EC DC 02 DA 80 0070 | 2A 21 1B 80 65 80 41 62 50 47 A4 42 96 E9 E4 10
0080 | 48 36 B6 03 07 BA 45 CA BE 17 AA 38 C9 14 FC A0 0080 | 3C 28 6B 9E 29 37 78 70 DE B3 64 F9 C7 41 83 5B
0090 | 5E 87 F2 F7 C0 0D DA 86 27 9A EE E0 A0 0F 07 40 0090 | 60 02 FF 28 41 63 78 2C 38 0F 7D 8D 54 24 B1 20
00A0 | EB 88 86 3E BD 2B 87 94 72 A5 34 39 35 72 72 85 00A0 | 30 62 6C A5 9A E9 D5 9F 8B 8B 6A 9F DC 6E 4F 56
00B0 | 38 68 19 EE 48 01 24 12 A8 67 66 EE E5 4E E9 4A 00B0 | B2 5C DF B3 E6 DD 94 2D 94 67 A2 52 A2 88 D9 42
00C0 | 48 0D AF 5D 6C 66 77 7D C8 F1 F6 1F 14 94 98 08 00C0 | 7A 14 D1 76 49 8F 8E 27 50 50 E3 D9 45 71 BB 91
00D0 | 8E 4C FF D9 72 31 7F 2F 50 A5 AD F7 65 96 B3 02 00D0 | 80 51 54 49 1A 93 8E C2 25 1C C9 DC 26 42 16 BA
00E0 | C5 6F 58 77 06 18 17 C0 FB C1 5E 85 2F 35 C6 73 00E0 | D1 71 58 3C 94 DE 1D 66 6A FE 7C BA CE C3 19 F6
00F0 | A6 65 8D A1 20 53 DD DD 65 29 7F E6 F9 F3 1A 96 00F0 | 0E 13 07 B7 33 11 EB 87 0D 82 1C C2 06 13 BE DC
0100 | 99 BD 50 86 1F F8 8C BB C0 B3 7F F3 F4 CC BA 3D 0100 | 74 51 45 F8 EB CF 4D C4 30 28 4A 05 B9 FA 1E A8
0110 | B6 7A 26 0F 31 DB 11 3A E1 41 D8 24 DA 0F 62 51 0110 | A0 70 0C 33 6C 85 A7 4B F8 74 84 53 8F 3D 5A DF
0120 | 9B D2 44 88 78 CE DA 3A 7B 20 7C 42 E3 57 62 D6 0120 | 6D 53 4E 06 89 35 77 DB 1E 8C 4F 0B B4 D2 EB 4A
0130 | D2 52 E0 0D AE 36 64 39 72 C4 EE 59 FC 91 9D F5 0130 | 44 04 EA 5E E2 7F B8 64 57 94 5F 2B F4 20 16 BD
0140 | 5F 14 CF 8F AA 2F 92 14 FE 46 87 FD 5C 05 8F 7D 0140 | AE F8 03 41 1C 43 C0 F0 63 39 B9 0D 7D 28 41 B3
0150 | 7E 83 2D 09</code></pre> 0150 | C5 C3 74 12</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 = 0E2699DFACC1B6A2D082AEBE8C63650321BB14AFE76B6E0DDF2A8A6FF
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>ECB60B0089FB9766</code></td> <td><code>7C1B0B00BAFB9766</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 = 0E2699DFACC1B6A2D082AEBE8C63650321BB14AFE76B6E0DDF2A8A6FF
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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>2FC97BB4A7294A978D2218F039ECB286</code></td> <td><code>BD909B93BEF0961A95C6375AD6CF6EB5</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>0453F5E967000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1408624999</td> <td><code>0460418613000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1614906899</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>045EF451CB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1593070027</td> <td><code>046E5F94D1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1851757777</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 = 0E2699DFACC1B6A2D082AEBE8C63650321BB14AFE76B6E0DDF2A8A6FF
<tr> <tr>
<td>encrypted_data</td> <td>encrypted_data</td>
<td>80, 260</td> <td>80, 260</td>
<td><code>FE000100309798B07DE64CAE6DB0111C</code> <code>1848BD936E2C4B2BD3A17401E5448A35</code> <code>60E72351D6BB5F7B2D753BECDC02DA80</code> <code>4836B60307BA45CABE17AA38C914FCA0</code> <code>5E87F2F7C00DDA86279AEEE0A00F0740</code> <code>EB88863EBD2B879472A5343935727285</code> <code>386819EE48012412A86766EEE54EE94A</code> <code>480DAF5D6C66777DC8F1F61F14949808</code> <code>8E4CFFD972317F2F50A5ADF76596B302</code> <code>C56F5877061817C0FBC15E852F35C673</code> <code>A6658DA12053DDDD65297FE6F9F31A96</code> <code>99BD50861FF88CBBC0B37FF3F4CCBA3D</code> <code>B67A260F31DB113AE141D824DA0F6251</code> <code>9BD2448878CEDA3A7B207C42E35762D6</code> <code>D252E00DAE36643972C4EE59FC919DF5</code> <code>5F14CF8FAA2F9214FE4687FD5C058F7D</code><br> <code>7E832D09</code></td> <td><code>FE0001007179356E012AA6DEEB3C68B4</code> <code>4AB1212A369EBAA91FCFD005C39F7D13</code> <code>2A211B80658041625047A44296E9E410</code> <code>3C286B9E29377870DEB364F9C741835B</code> <code>6002FF284163782C380F7D8D5424B120</code> <code>30626CA59AE9D59F8B8B6A9FDC6E4F56</code> <code>B25CDFB3E6DD942D9467A252A288D942</code> <code>7A14D176498F8E275050E3D94571BB91</code> <code>805154491A938EC2251CC9DC264216BA</code> <code>D171583C94DE1D666AFE7CBACEC319F6</code> <code>0E1307B73311EB870D821CC20613BEDC</code> <code>745145F8EBCF4DC430284A05B9FA1EA8</code> <code>A0700C336C85A74BF87484538F3D5ADF</code> <code>6D534E06893577DB1E8C4F0BB4D2EB4A</code> <code>4404EA5EE27FB86457945F2BF42016BD</code> <code>AEF803411C43C0F06339B90D7D2841B3</code><br> <code>C5C37412</code></td>
<td>Value generated above</td> <td>Value generated above</td>
</tr> </tr>
</tbody> </tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 0E2699DFACC1B6A2D082AEBE8C63650321BB14AFE76B6E0DDF2A8A6FF
<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 A4 FD 2D 8A FB 97 66 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 74 0A 03 BB FB 97 66
0010 | E4 02 00 00 5C 07 E8 D0 AE 3C 4B 5C 6F 3C 2B 0D 0010 | 78 02 00 00 5C 07 E8 D0 9B DE 3C 06 C0 EF 93 D9
0020 | 7D 27 2F 73 3E 43 D7 16 2F C9 7B B4 A7 29 4A 97 0020 | 72 AF 72 00 A0 EA F5 AB BD 90 9B 93 BE F0 96 1A
0030 | 8D 22 18 F0 39 EC B2 86 FE 50 02 00 97 5B 48 71 0030 | 95 C6 37 5A D6 CF 6E B5 FE 50 02 00 49 39 5C 7C
0040 | 85 A4 2B D9 73 ED DA 56 46 88 39 DF 4B DC 23 52 0040 | 04 76 90 5C 52 1F 55 EE A8 F1 42 52 EB 0F EF 60
0050 | 1C 76 90 9D BB 7F 72 71 79 57 34 D2 AF 47 48 49 0050 | 81 03 27 62 A6 AE 3C 78 59 7C C7 65 76 37 18 89
0060 | D2 20 0F 5D 17 E4 34 74 A4 7E 29 B0 DD 1D 6C A7 0060 | E6 F1 01 6D 6F 3B 84 F8 DA 15 30 A0 55 9A E7 02
0070 | 67 CC BC E3 E1 7E A2 F6 76 2D 75 51 2C A0 D1 BD 0070 | 6D 49 B0 2A 03 20 31 96 D7 75 5D 47 B0 C5 7F 10
0080 | 29 CB 5C 19 B7 DB D2 11 C3 7D 40 AB 71 8C 03 E1 0080 | A5 B3 C9 64 E6 3E E6 1E 4B A6 BD 39 B8 82 57 59
0090 | 9D F4 F4 F2 03 C5 C4 E5 BD 8E D3 75 40 47 D9 DC 0090 | DC 9A 29 F9 B2 A7 06 EC E7 F7 E2 4F 97 B6 C7 1B
00A0 | 1B 7B C1 15 29 48 41 BE C2 8D 6A 27 9E F8 BB BA 00A0 | 0F 0A 1E 02 04 2E 96 34 7E AE 13 2A 20 36 F4 98
00B0 | BF 75 9A 1D AB 8E F5 3D 83 BC F0 6F DB F7 C1 50 00B0 | D0 5D 9E 75 2A 50 B0 5E 35 94 BF 57 B8 8D 9F 48
00C0 | 8A 8F 59 55 D7 5D C7 CB 86 C0 AD DD 2E 6D 59 22 00C0 | 8F 3B 64 93 B6 7E 95 90 20 1A 78 7E 37 3E C4 4D
00D0 | 80 88 D4 90 80 AC A6 5D 93 9E C4 34 19 A9 55 46 00D0 | 10 B1 E9 23 69 D0 16 C9 22 E1 26 3C 43 FF F3 15
00E0 | 9B 98 36 A4 88 69 D9 0B DE FE B7 55 5C 0A B3 63 00E0 | 3C 47 E7 96 26 A1 4C 29 24 6A D9 78 B6 51 F2 9C
00F0 | 4A 4E 6A 60 69 A9 85 74 32 52 F3 28 4F 16 87 82 00F0 | 5E B5 5F 63 97 7A 65 95 E4 5F 85 69 E1 5C D9 28
0100 | B9 93 BF 72 29 25 19 0B F1 FE 79 94 03 DE C1 BC 0100 | A9 99 B2 A5 D2 3C 75 EC 5A 16 72 64 9C 5E CE 38
0110 | 28 94 C2 75 C0 2D 0B 04 8C EF 8B A7 7C BF D0 C0 0110 | 8F C3 9F EF B4 E9 C2 BD 0F FA CC 9A C6 D8 4D B4
0120 | 6A A0 63 7C 5E CD D1 FC 23 1E D2 B8 FA 7B 1B 7E 0120 | 29 AA 8B 8C 8E 18 AD F6 9E 25 12 BF 10 91 1A 9A
0130 | 83 2E 22 69 BA 9B 62 FB 6B B9 95 58 A1 3A 0C F5 0130 | A0 57 7F DA 9B 3B E2 06 3C B6 DF CB 58 43 53 6B
0140 | 76 1D 4E B9 0A 2C D1 8D E0 BA BE BC 86 B6 C7 DB 0140 | 34 B3 CC C7 CB 61 47 4A 26 AE 0D 25 E4 F5 32 48
0150 | AF 83 13 7E B5 47 3A FB 3F 03 5C 15 D9 DD 5D 2D 0150 | D8 78 A9 CF 48 7E 66 3D C3 B2 27 30 9E 44 82 15
0160 | 65 14 68 35 CB 6B AB 39 4A 83 36 CA EC 75 B9 9B 0160 | F4 39 BC AC D3 96 A0 1B D6 E6 94 24 A2 DA 9B 33
0170 | 1E 92 3D 7E D5 5A 9F 1C 3B 96 E3 6D 6A B2 11 9C 0170 | C4 B6 9C 70 7C 5B 0A BA 87 9E 76 D7 A7 7F 9A CC
0180 | 45 24 41 DE AE 66 F4 B1 5A 91 8F FC BC C4 42 7D 0180 | 5A 0B 9E 54 EE 6D E0 5B F2 B9 C2 14 4D AF E1 87
0190 | 49 5D A2 57 02 A5 84 DA 27 E4 F0 C5 9C E5 01 99 0190 | B7 7D AE C4 9E 0E 32 A9 17 C5 C4 CF A8 59 12 63
01A0 | 99 BF 0B 8E 2A 81 0F B5 25 D2 DD 92 04 91 02 B1 01A0 | 97 D7 2E 35 3E 1E CD 42 C4 3C BB F4 2C E0 31 8A
01B0 | 57 95 24 CB 7B D6 2C 71 4E E2 29 0E EB 6F 4D 0B 01B0 | 89 63 37 1F 01 DB 00 B6 23 7A 4D FB D8 07 CE BD
01C0 | 69 9F 11 89 6D 49 A7 3F 24 BC BE 7D AF 23 04 71 01C0 | F0 5A A5 D1 CD 01 85 78 FE EE 49 C9 E1 45 E6 A2
01D0 | 88 D1 7E ED 8B 92 71 48 79 80 0B AB DF 4C 9D FB 01D0 | 77 04 99 88 A1 AD 29 C4 85 52 2B 83 E9 A2 0F BA
01E0 | 12 A3 3F 00 68 D6 52 5F 1A 6B 22 17 78 5E 52 68 01E0 | D7 8F 92 97 51 62 6C 76 20 5B CA 0E 95 18 78 0D
01F0 | 8E 21 42 6F 3B 62 D7 54 8C 56 96 15 E8 0F 46 AC 01F0 | E8 76 9D 29 F9 68 9A D9 8D 6C B0 EA 0D 58 E2 D1
0200 | FE F3 79 2E 28 80 A6 BE 2D C1 0A 91 26 E1 C6 CA 0200 | CB E6 D5 DD 23 1E 16 51 9A EA EF 1B B9 10 C0 1A
0210 | 71 13 10 FF DE FB 46 0F C3 A4 CE 0A 7F EB 21 42 0210 | FA 56 CE 8E 09 00 33 A7 08 50 E8 7D D7 53 3E 1C
0220 | 84 C7 46 15 31 F3 22 0A F2 D4 7C 37 8A 0B B8 FD 0220 | CD 33 F7 B0 08 2A 95 E2 24 0D E2 DC 0E E5 60 22
0230 | 55 D1 9D 06 30 9F F5 FC DF 7B A5 51 6F 23 A0 C2 0230 | 51 EA 44 30 80 0C 7B C8 6C 27 45 53 65 94 B8 24
0240 | 76 5C 4F 47 1F F4 8D 8B 53 01 A2 BC 85 59 C6 69 0240 | 1F FE DB B0 A0 BB 7F 9A 3E 09 33 ED 87 38 B7 77
0250 | 4C FD 9D 53 7C E4 27 64 92 34 86 3F B6 1B C7 2D 0250 | 14 72 1C AC CB 47 1A 83 0F 03 54 0E 7D 1C A7 B2
0260 | 1A 2B A0 3C FC AA 1B 17 A1 35 54 A9 80 C7 5A 04 0260 | 9E 36 F0 88 A5 91 F6 81 BD 60 0F 67 4D AD 50 64
0270 | 56 00 6F 45 73 91 E0 F6 CD 7A A8 A3 90 68 91 5D 0270 | 10 4C 25 05 14 37 4C FB 12 46 29 ED 1D 9B 41 B6
0280 | D1 8A FA 82 5F D3 8A 52 26 E7 C3 B5</code></pre> 0280 | B6 50 6B C1 32 69 5E FA E3 E8 AA 25</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 = 0E2699DFACC1B6A2D082AEBE8C63650321BB14AFE76B6E0DDF2A8A6FF
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>01A4FD2D8AFB9766</code></td> <td><code>01740A03BBFB9766</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>E4020000</code> (740 in decimal)</td> <td><code>78020000</code> (632 in decimal)</td>
<td>Message body length</td> <td>Message body length</td>
</tr> </tr>
<tr> <tr>
@ -482,19 +482,19 @@ random_padding_bytes = 0E2699DFACC1B6A2D082AEBE8C63650321BB14AFE76B6E0DDF2A8A6FF
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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>2FC97BB4A7294A978D2218F039ECB286</code></td> <td><code>BD909B93BEF0961A95C6375AD6CF6EB5</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>FE500200975B487185A42BD973EDDA56</code> <code>468839DF4BDC23521C76909DBB7F7271</code> <code>795734D2AF474849D2200F5D17E43474</code> <code>A47E29B0DD1D6CA767CCBCE3E17EA2F6</code> <code>762D75512CA0D1BD29CB5C19B7DBD211</code> <code>C37D40AB718C03E19DF4F4F203C5C4E5</code> <code>BD8ED3754047D9DC1B7BC115294841BE</code> <code>C28D6A279EF8BBBABF759A1DAB8EF53D</code> <code>83BCF06FDBF7C1508A8F5955D75DC7CB</code> <code>86C0ADDD2E6D59228088D49080ACA65D</code> <code>939EC43419A955469B9836A48869D90B</code> <code>DEFEB7555C0AB3634A4E6A6069A98574</code> <code>3252F3284F168782B993BF722925190B</code> <code>F1FE799403DEC1BC2894C275C02D0B04</code> <code>8CEF8BA77CBFD0C06AA0637C5ECDD1FC</code> <code>231ED2B8FA7B1B7E832E2269BA9B62FB</code> <code>6BB99558A13A0CF5761D4EB90A2CD18D</code> <code>E0BABEBC86B6C7DBAF83137EB5473AFB</code> <code>3F035C15D9DD5D2D65146835CB6BAB39</code> <code>4A8336CAEC75B99B1E923D7ED55A9F1C</code> <code>3B96E36D6AB2119C452441DEAE66F4B1</code> <code>5A918FFCBCC4427D495DA25702A584DA</code> <code>27E4F0C59CE5019999BF0B8E2A810FB5</code> <code>25D2DD92049102B1579524CB7BD62C71</code> <code>4EE2290EEB6F4D0B699F11896D49A73F</code> <code>24BCBE7DAF23047188D17EED8B927148</code> <code>79800BABDF4C9DFB12A33F0068D6525F</code> <code>1A6B2217785E52688E21426F3B62D754</code> <code>8C569615E80F46ACFEF3792E2880A6BE</code> <code>2DC10A9126E1C6CA711310FFDEFB460F</code> <code>C3A4CE0A7FEB214284C7461531F3220A</code> <code>F2D47C378A0BB8FD55D19D06309FF5FC</code> <code>DF7BA5516F23A0C2765C4F471FF48D8B</code> <code>5301A2BC8559C6694CFD9D537CE42764</code> <code>9234863FB61BC72D1A2BA03CFCAA1B17</code> <code>A13554A980C75A0456006F457391E0F6</code> <code>CD7AA8A39068915DD18AFA825FD38A52</code><br> <code>26E7C3B5</code></td> <td><code>FE50020049395C7C0476905C521F55EE</code> <code>A8F14252EB0FEF6081032762A6AE3C78</code> <code>597CC76576371889E6F1016D6F3B84F8</code> <code>DA1530A0559AE7026D49B02A03203196</code> <code>D7755D47B0C57F10A5B3C964E63EE61E</code> <code>4BA6BD39B8825759DC9A29F9B2A706EC</code> <code>E7F7E24F97B6C71B0F0A1E02042E9634</code> <code>7EAE132A2036F498D05D9E752A50B05E</code> <code>3594BF57B88D9F488F3B6493B67E9590</code> <code>201A787E373EC44D10B1E92369D016C9</code> <code>22E1263C43FFF3153C47E79626A14C29</code> <code>246AD978B651F29C5EB55F63977A6595</code> <code>E45F8569E15CD928A999B2A5D23C75EC</code> <code>5A1672649C5ECE388FC39FEFB4E9C2BD</code> <code>0FFACC9AC6D84DB429AA8B8C8E18ADF6</code> <code>9E2512BF10911A9AA0577FDA9B3BE206</code> <code>3CB6DFCB5843536B34B3CCC7CB61474A</code> <code>26AE0D25E4F53248D878A9CF487E663D</code> <code>C3B227309E448215F439BCACD396A01B</code> <code>D6E69424A2DA9B33C4B69C707C5B0ABA</code> <code>879E76D7A77F9ACC5A0B9E54EE6DE05B</code> <code>F2B9C2144DAFE187B77DAEC49E0E32A9</code> <code>17C5C4CFA859126397D72E353E1ECD42</code> <code>C43CBBF42CE0318A8963371F01DB00B6</code> <code>237A4DFBD807CEBDF05AA5D1CD018578</code> <code>FEEE49C9E145E6A277049988A1AD29C4</code> <code>85522B83E9A20FBAD78F929751626C76</code> <code>205BCA0E9518780DE8769D29F9689AD9</code> <code>8D6CB0EA0D58E2D1CBE6D5DD231E1651</code> <code>9AEAEF1BB910C01AFA56CE8E090033A7</code> <code>0850E87DD7533E1CCD33F7B0082A95E2</code> <code>240DE2DC0EE5602251EA4430800C7BC8</code> <code>6C2745536594B8241FFEDBB0A0BB7F9A</code> <code>3E0933ED8738B77714721CACCB471A83</code> <code>0F03540E7D1CA7B29E36F088A591F681</code> <code>BD600F674DAD5064104C250514374CFB</code> <code>124629ED1D9B41B6B6506BC132695EFA</code><br> <code>E3E8AA25</code></td>
<td>See below</td> <td>See below</td>
</tr> </tr>
</tbody> </tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 0E2699DFACC1B6A2D082AEBE8C63650321BB14AFE76B6E0DDF2A8A6FF
<!-- 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 = 975B487185A42BD973EDDA56468839DF4BDC23521C76909DBB7F7271795734D2AF474849D2200F5D17E43474A47E29B0DD1D6CA767CCBCE3E17EA2F6762D75512CA0D1BD29CB5C19B7DBD211C37D40AB718C03E19DF4F4F203C5C4E5BD8ED3754047D9DC1B7BC115294841BEC28D6A279EF8BBBABF759A1DAB8EF53D83BCF06FDBF7C1508A8F5955D75DC7CB86C0ADDD2E6D59228088D49080ACA65D939EC43419A955469B9836A48869D90BDEFEB7555C0AB3634A4E6A6069A985743252F3284F168782B993BF722925190BF1FE799403DEC1BC2894C275C02D0B048CEF8BA77CBFD0C06AA0637C5ECDD1FC231ED2B8FA7B1B7E832E2269BA9B62FB6BB99558A13A0CF5761D4EB90A2CD18DE0BABEBC86B6C7DBAF83137EB5473AFB3F035C15D9DD5D2D65146835CB6BAB394A8336CAEC75B99B1E923D7ED55A9F1C3B96E36D6AB2119C452441DEAE66F4B15A918FFCBCC4427D495DA25702A584DA27E4F0C59CE5019999BF0B8E2A810FB525D2DD92049102B1579524CB7BD62C714EE2290EEB6F4D0B699F11896D49A73F24BCBE7DAF23047188D17EED8B92714879800BABDF4C9DFB12A33F0068D6525F1A6B2217785E52688E21426F3B62D7548C569615E80F46ACFEF3792E2880A6BE2DC10A9126E1C6CA711310FFDEFB460FC3A4CE0A7FEB214284C7461531F3220AF2D47C378A0BB8FD55D19D06309FF5FCDF7BA5516F23A0C2765C4F471FF48D8B5301A2BC8559C6694CFD9D537CE427649234863FB61BC72D1A2BA03CFCAA1B17A13554A980C75A0456006F457391E0F6CD7AA8A39068915DD18AFA825FD38A5226E7C3B5 <pre><code>encrypted_answer = 49395C7C0476905C521F55EEA8F14252EB0FEF6081032762A6AE3C78597CC76576371889E6F1016D6F3B84F8DA1530A0559AE7026D49B02A03203196D7755D47B0C57F10A5B3C964E63EE61E4BA6BD39B8825759DC9A29F9B2A706ECE7F7E24F97B6C71B0F0A1E02042E96347EAE132A2036F498D05D9E752A50B05E3594BF57B88D9F488F3B6493B67E9590201A787E373EC44D10B1E92369D016C922E1263C43FFF3153C47E79626A14C29246AD978B651F29C5EB55F63977A6595E45F8569E15CD928A999B2A5D23C75EC5A1672649C5ECE388FC39FEFB4E9C2BD0FFACC9AC6D84DB429AA8B8C8E18ADF69E2512BF10911A9AA0577FDA9B3BE2063CB6DFCB5843536B34B3CCC7CB61474A26AE0D25E4F53248D878A9CF487E663DC3B227309E448215F439BCACD396A01BD6E69424A2DA9B33C4B69C707C5B0ABA879E76D7A77F9ACC5A0B9E54EE6DE05BF2B9C2144DAFE187B77DAEC49E0E32A917C5C4CFA859126397D72E353E1ECD42C43CBBF42CE0318A8963371F01DB00B6237A4DFBD807CEBDF05AA5D1CD018578FEEE49C9E145E6A277049988A1AD29C485522B83E9A20FBAD78F929751626C76205BCA0E9518780DE8769D29F9689AD98D6CB0EA0D58E2D1CBE6D5DD231E16519AEAEF1BB910C01AFA56CE8E090033A70850E87DD7533E1CCD33F7B0082A95E2240DE2DC0EE5602251EA4430800C7BC86C2745536594B8241FFEDBB0A0BB7F9A3E0933ED8738B77714721CACCB471A830F03540E7D1CA7B29E36F088A591F681BD600F674DAD5064104C250514374CFB124629ED1D9B41B6B6506BC132695EFAE3E8AA25
tmp_aes_key = BC4BB4D5C4F912636BB5A3D4219F1925CD6E756F9E6725E97483C3DE053BFF5D tmp_aes_key = 402A22230C9BB7E1AAF6E978F76FCF6E641F1B62DBCA2BF60FC95A1BAD45F56C
tmp_aes_iv = A13FE055E9216E10852EEAEA353FBA643B7F0ACA7980AE2C20635707931C0118</code></pre> tmp_aes_iv = C4BAAC5594932970391D732F1FF2A0CCDBB82F8CC63F5D5BB844A9234D3E1A6F</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 = 961B9875971383CEAB2D2F776FB5BD243242EB94BA0D89B5AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB28603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100BA3A312DB835FDBBBABB7545AEECFC6D0DD1544B81A03268F431DD7DC59AD953379A9CB6AAC6BCA19936D4C49CEECF7A58547E924A52190B2AB6FE40BFA6CB8074308E1CA1DAA30B0AAA77B04C4CBD3AB7D3E83E25ED1C413497B4634C98A0E3BFA21DA80050A1A6AEEBBE3BCE4C54C433F6CE9AE4126A20E1EA4984FA7A9868F60D3AC18169FADCF48EE448A430AD6296FC69C692CC320AC1DAE2A15679D561D5323AD075D93F3BEDEEA1DA886A131A8C243EEB0182FE6D0CA7D14C2A83FBC23345216859B1594B0FE4B07C5768DAEC4305B9A9E681B8AFB410EB91626014C2923D638FDC99E14F85B66F4BCF96591074293E51342C87655829C524545113C48AFB9766A21E7D0748F66A5E <pre><code>answer_with_hash = E421EE86B1B2406E293D4250709A03950668500DBA0D89B59BDE3C06C0EF93D972AF7200A0EAF5ABBD909B93BEF0961A95C6375AD6CF6EB503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007ECBBFA544A985176C847DE6DCF401F2B93FFD3F0224B001CAE4C41894A9C7829B3211AB7DD023D603010F9AD6BE132D508874983BE0CFAEA25746E095A904F2364CE7174C27BDC7D4D4BD177A6AB18620E4F8DAE00C7FFC17B20347872FF59C1066F4D6160AB9C5E3C809948192F61A3828773730D66EBD6EF9DFC09A25F68A1E788904730A93DE2A246D9642717B5482814EC15DFFF639A577B07D5C3C1BAA69B69FC587ABCA463E143440F60B6032B884F4947204B11B33A48BCE2F9E910195D499AF07450CCA3844F8421618AA748E737FD26F775E4438CBDBC6BDFCA972476C8AF1C42418D337B939C2A78BA36D320916114928154140D89513C04D8409BBFB9766550555BFD8381C31
answer = BA0D89B5AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB28603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100BA3A312DB835FDBBBABB7545AEECFC6D0DD1544B81A03268F431DD7DC59AD953379A9CB6AAC6BCA19936D4C49CEECF7A58547E924A52190B2AB6FE40BFA6CB8074308E1CA1DAA30B0AAA77B04C4CBD3AB7D3E83E25ED1C413497B4634C98A0E3BFA21DA80050A1A6AEEBBE3BCE4C54C433F6CE9AE4126A20E1EA4984FA7A9868F60D3AC18169FADCF48EE448A430AD6296FC69C692CC320AC1DAE2A15679D561D5323AD075D93F3BEDEEA1DA886A131A8C243EEB0182FE6D0CA7D14C2A83FBC23345216859B1594B0FE4B07C5768DAEC4305B9A9E681B8AFB410EB91626014C2923D638FDC99E14F85B66F4BCF96591074293E51342C87655829C524545113C48AFB9766A21E7D0748F66A5E</code></pre> answer = BA0D89B59BDE3C06C0EF93D972AF7200A0EAF5ABBD909B93BEF0961A95C6375AD6CF6EB503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007ECBBFA544A985176C847DE6DCF401F2B93FFD3F0224B001CAE4C41894A9C7829B3211AB7DD023D603010F9AD6BE132D508874983BE0CFAEA25746E095A904F2364CE7174C27BDC7D4D4BD177A6AB18620E4F8DAE00C7FFC17B20347872FF59C1066F4D6160AB9C5E3C809948192F61A3828773730D66EBD6EF9DFC09A25F68A1E788904730A93DE2A246D9642717B5482814EC15DFFF639A577B07D5C3C1BAA69B69FC587ABCA463E143440F60B6032B884F4947204B11B33A48BCE2F9E910195D499AF07450CCA3844F8421618AA748E737FD26F775E4438CBDBC6BDFCA972476C8AF1C42418D337B939C2A78BA36D320916114928154140D89513C04D8409BBFB9766550555BFD8381C31</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 AE 3C 4B 5C 6F 3C 2B 0D 7D 27 2F 73 <pre><code>0000 | BA 0D 89 B5 9B DE 3C 06 C0 EF 93 D9 72 AF 72 00
0010 | 3E 43 D7 16 2F C9 7B B4 A7 29 4A 97 8D 22 18 F0 0010 | A0 EA F5 AB BD 90 9B 93 BE F0 96 1A 95 C6 37 5A
0020 | 39 EC B2 86 03 00 00 00 FE 00 01 00 C7 1C AE B9 0020 | D6 CF 6E B5 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 = BA0D89B5AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB28
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 | BA 3A 31 2D B8 35 FD BB BA BB 75 45 AE EC FC 6D 0130 | 7E CB BF A5 44 A9 85 17 6C 84 7D E6 DC F4 01 F2
0140 | 0D D1 54 4B 81 A0 32 68 F4 31 DD 7D C5 9A D9 53 0140 | B9 3F FD 3F 02 24 B0 01 CA E4 C4 18 94 A9 C7 82
0150 | 37 9A 9C B6 AA C6 BC A1 99 36 D4 C4 9C EE CF 7A 0150 | 9B 32 11 AB 7D D0 23 D6 03 01 0F 9A D6 BE 13 2D
0160 | 58 54 7E 92 4A 52 19 0B 2A B6 FE 40 BF A6 CB 80 0160 | 50 88 74 98 3B E0 CF AE A2 57 46 E0 95 A9 04 F2
0170 | 74 30 8E 1C A1 DA A3 0B 0A AA 77 B0 4C 4C BD 3A 0170 | 36 4C E7 17 4C 27 BD C7 D4 D4 BD 17 7A 6A B1 86
0180 | B7 D3 E8 3E 25 ED 1C 41 34 97 B4 63 4C 98 A0 E3 0180 | 20 E4 F8 DA E0 0C 7F FC 17 B2 03 47 87 2F F5 9C
0190 | BF A2 1D A8 00 50 A1 A6 AE EB BE 3B CE 4C 54 C4 0190 | 10 66 F4 D6 16 0A B9 C5 E3 C8 09 94 81 92 F6 1A
01A0 | 33 F6 CE 9A E4 12 6A 20 E1 EA 49 84 FA 7A 98 68 01A0 | 38 28 77 37 30 D6 6E BD 6E F9 DF C0 9A 25 F6 8A
01B0 | F6 0D 3A C1 81 69 FA DC F4 8E E4 48 A4 30 AD 62 01B0 | 1E 78 89 04 73 0A 93 DE 2A 24 6D 96 42 71 7B 54
01C0 | 96 FC 69 C6 92 CC 32 0A C1 DA E2 A1 56 79 D5 61 01C0 | 82 81 4E C1 5D FF F6 39 A5 77 B0 7D 5C 3C 1B AA
01D0 | D5 32 3A D0 75 D9 3F 3B ED EE A1 DA 88 6A 13 1A 01D0 | 69 B6 9F C5 87 AB CA 46 3E 14 34 40 F6 0B 60 32
01E0 | 8C 24 3E EB 01 82 FE 6D 0C A7 D1 4C 2A 83 FB C2 01E0 | B8 84 F4 94 72 04 B1 1B 33 A4 8B CE 2F 9E 91 01
01F0 | 33 45 21 68 59 B1 59 4B 0F E4 B0 7C 57 68 DA EC 01F0 | 95 D4 99 AF 07 45 0C CA 38 44 F8 42 16 18 AA 74
0200 | 43 05 B9 A9 E6 81 B8 AF B4 10 EB 91 62 60 14 C2 0200 | 8E 73 7F D2 6F 77 5E 44 38 CB DB C6 BD FC A9 72
0210 | 92 3D 63 8F DC 99 E1 4F 85 B6 6F 4B CF 96 59 10 0210 | 47 6C 8A F1 C4 24 18 D3 37 B9 39 C2 A7 8B A3 6D
0220 | 74 29 3E 51 34 2C 87 65 58 29 C5 24 54 51 13 C4 0220 | 32 09 16 11 49 28 15 41 40 D8 95 13 C0 4D 84 09
0230 | 8A FB 97 66</code></pre> 0230 | BB FB 97 66</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 = BA0D89B5AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB28
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>4, 16</td> <td>4, 16</td>
<td><code>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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>2FC97BB4A7294A978D2218F039ECB286</code></td> <td><code>BD909B93BEF0961A95C6375AD6CF6EB5</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 = BA0D89B5AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB28
<tr> <tr>
<td>g_a</td> <td>g_a</td>
<td>300, 260</td> <td>300, 260</td>
<td><code>FE000100BA3A312DB835FDBBBABB7545</code> <code>AEECFC6D0DD1544B81A03268F431DD7D</code> <code>C59AD953379A9CB6AAC6BCA19936D4C4</code> <code>9CEECF7A58547E924A52190B2AB6FE40</code> <code>BFA6CB8074308E1CA1DAA30B0AAA77B0</code> <code>4C4CBD3AB7D3E83E25ED1C413497B463</code> <code>4C98A0E3BFA21DA80050A1A6AEEBBE3B</code> <code>CE4C54C433F6CE9AE4126A20E1EA4984</code> <code>FA7A9868F60D3AC18169FADCF48EE448</code> <code>A430AD6296FC69C692CC320AC1DAE2A1</code> <code>5679D561D5323AD075D93F3BEDEEA1DA</code> <code>886A131A8C243EEB0182FE6D0CA7D14C</code> <code>2A83FBC23345216859B1594B0FE4B07C</code> <code>5768DAEC4305B9A9E681B8AFB410EB91</code> <code>626014C2923D638FDC99E14F85B66F4B</code> <code>CF96591074293E51342C87655829C524</code><br> <code>545113C4</code></td> <td><code>FE0001007ECBBFA544A985176C847DE6</code> <code>DCF401F2B93FFD3F0224B001CAE4C418</code> <code>94A9C7829B3211AB7DD023D603010F9A</code> <code>D6BE132D508874983BE0CFAEA25746E0</code> <code>95A904F2364CE7174C27BDC7D4D4BD17</code> <code>7A6AB18620E4F8DAE00C7FFC17B20347</code> <code>872FF59C1066F4D6160AB9C5E3C80994</code> <code>8192F61A3828773730D66EBD6EF9DFC0</code> <code>9A25F68A1E788904730A93DE2A246D96</code> <code>42717B5482814EC15DFFF639A577B07D</code> <code>5C3C1BAA69B69FC587ABCA463E143440</code> <code>F60B6032B884F4947204B11B33A48BCE</code> <code>2F9E910195D499AF07450CCA3844F842</code> <code>1618AA748E737FD26F775E4438CBDBC6</code> <code>BDFCA972476C8AF1C42418D337B939C2</code> <code>A78BA36D320916114928154140D89513</code><br> <code>C04D8409</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>8AFB9766</code> (1721236362 in decimal)</td> <td><code>BBFB9766</code> (1721236411 in decimal)</td>
<td>Server time</td> <td>Server time</td>
</tr> </tr>
</tbody> </tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB28
<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 = 4406BC2FE9FD9A1433D43B469A59C65F53A050155251BAF69FA08F2EF888B3553F1406F8EC5A9ABFDF8F7954820A634942EC7D328D8548E5FDB222A491A7094CFAA201FEEA6F9AC2975F35B017156A93A4EFDAF8D4C219011D82BF626BD2DECB47D0F7964BD8D605F9D7093D1BC59781F7FC1E879C8CF62D584B4BBE0EB392958D828ECE29E7CBBD3B3CB35E66661D3204794C721FA4BE30C11EA7C95D1D075414FE2E778B926C9AAB1A6921161987B7256CF52974CF7B343DA5BF04CDB0EDEC24A945989D2D9D78A8C8E707EA82B523901FF3376BCB3168A042416E026F9F17E3ABB7CBF5F8C572BE387C97CF96CCCA89F25CD8375DD679E4A2AD131BC23F9B</code></pre> <pre><code>b = ECA740BED253508A350F5B87AEFE93FEE28E9C67872CF4F6C005A7DEF3525D41A649A046AD663092159DABA47492882A8F8067449CE0B8D2DBD4E0021DB82F7C51A3F4641862C0D95876D5862F98DD0A4AB9D305A044F63DE3271B3C6ECF036255784EACC35641B56C6BBED8E90984C79D422666E5EC045EAFED87D223FD79CE5CCE5783DDB6EF22F2DCD7FF660D4DBE84A124338C91C6672047630B4A470A2D50FFDB980FFAF8E5658E4D29A4D66D0BBA52891EDAFF77B3EC302740E3CA8FCD1A8AC8876C3124FFFD51978FD65E2C28766D51E8493C81268447F5FA54EE06BD1F5FD43E752C3119A6216388407AA612699770BB1E58DB5084947688C8A69CC9</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 = 26F04C7F105FAB7CEC3327DCAE6FB808E4BD2CF11C4FA238D9B7028D7C694E44289ABA0029FAF7F54CFE8919E9B2F07AA04952BE59BDC68516E6610382816B13B109D8FB0124A4C45CD7E7953F300D650EE3092B1E952BD9A9E9EBD55CCA88E3C62FAA80081511239B0FDC21D58DE71CAD8136C5BB2CE8B45806F091AFA91EBAD69D195C1724C1197768F65CAC1D3A3C0B8B3C3E21A555F2F92CD81B8326B54CF871ED06ECEBFA86D31B301892122490588DDFBBF07C5920EBA3913ACD72C3D142F7A8A95B08FAE2F05742A9A5DC0B53CC9B90D85921C13F0DE18538152EDCF6DDAA860B196E7D36E1E16CA045C38CF484FAD5E974B679A899EB563E69BEC09B</code></pre> <pre><code>g_b = 3C3BB4E4EABA39BC1998EC5F9678B04B287EEA079DBD277A727BB453DB1A3CFE6AA62178E3269DD6B3045F65EDC6D5D741A29EF8B098B914D07B2E65B556EAD4BDECA732A609C0C537616DB5E9995031FE5BCFBE3A9C9619995AC094D3A141987DC37FF28D0544D8D4D3FF123CD43A1B337077B1680D0B3CED329447D16B8A48916791567473277F78919CC2EBEA41351E7DFA3BB9F041026996F6C959268CFEA786A5158A9F1D1A59F5BB43852479AC3CFB5CA59DF5FD6627867C81D6E4524A0A2C8228A4E645CD5680CF3B74CD1D484F33FB4C9C2C0AEE5ACF516401041264C047F339D03A60329C20EEFF38F6C2D324DEED3807C8BE0B2C6C013AE14F40B9</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 AE 3C 4B 5C 6F 3C 2B 0D 7D 27 2F 73 <pre><code>0000 | 54 B6 43 66 9B DE 3C 06 C0 EF 93 D9 72 AF 72 00
0010 | 3E 43 D7 16 2F C9 7B B4 A7 29 4A 97 8D 22 18 F0 0010 | A0 EA F5 AB BD 90 9B 93 BE F0 96 1A 95 C6 37 5A
0020 | 39 EC B2 86 00 00 00 00 00 00 00 00 FE 00 01 00 0020 | D6 CF 6E B5 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 26 F0 4C 7F 10 5F AB 7C EC 33 27 DC AE 6F B8 08 0030 | 3C 3B B4 E4 EA BA 39 BC 19 98 EC 5F 96 78 B0 4B
0040 | E4 BD 2C F1 1C 4F A2 38 D9 B7 02 8D 7C 69 4E 44 0040 | 28 7E EA 07 9D BD 27 7A 72 7B B4 53 DB 1A 3C FE
0050 | 28 9A BA 00 29 FA F7 F5 4C FE 89 19 E9 B2 F0 7A 0050 | 6A A6 21 78 E3 26 9D D6 B3 04 5F 65 ED C6 D5 D7
0060 | A0 49 52 BE 59 BD C6 85 16 E6 61 03 82 81 6B 13 0060 | 41 A2 9E F8 B0 98 B9 14 D0 7B 2E 65 B5 56 EA D4
0070 | B1 09 D8 FB 01 24 A4 C4 5C D7 E7 95 3F 30 0D 65 0070 | BD EC A7 32 A6 09 C0 C5 37 61 6D B5 E9 99 50 31
0080 | 0E E3 09 2B 1E 95 2B D9 A9 E9 EB D5 5C CA 88 E3 0080 | FE 5B CF BE 3A 9C 96 19 99 5A C0 94 D3 A1 41 98
0090 | C6 2F AA 80 08 15 11 23 9B 0F DC 21 D5 8D E7 1C 0090 | 7D C3 7F F2 8D 05 44 D8 D4 D3 FF 12 3C D4 3A 1B
00A0 | AD 81 36 C5 BB 2C E8 B4 58 06 F0 91 AF A9 1E BA 00A0 | 33 70 77 B1 68 0D 0B 3C ED 32 94 47 D1 6B 8A 48
00B0 | D6 9D 19 5C 17 24 C1 19 77 68 F6 5C AC 1D 3A 3C 00B0 | 91 67 91 56 74 73 27 7F 78 91 9C C2 EB EA 41 35
00C0 | 0B 8B 3C 3E 21 A5 55 F2 F9 2C D8 1B 83 26 B5 4C 00C0 | 1E 7D FA 3B B9 F0 41 02 69 96 F6 C9 59 26 8C FE
00D0 | F8 71 ED 06 EC EB FA 86 D3 1B 30 18 92 12 24 90 00D0 | A7 86 A5 15 8A 9F 1D 1A 59 F5 BB 43 85 24 79 AC
00E0 | 58 8D DF BB F0 7C 59 20 EB A3 91 3A CD 72 C3 D1 00E0 | 3C FB 5C A5 9D F5 FD 66 27 86 7C 81 D6 E4 52 4A
00F0 | 42 F7 A8 A9 5B 08 FA E2 F0 57 42 A9 A5 DC 0B 53 00F0 | 0A 2C 82 28 A4 E6 45 CD 56 80 CF 3B 74 CD 1D 48
0100 | CC 9B 90 D8 59 21 C1 3F 0D E1 85 38 15 2E DC F6 0100 | 4F 33 FB 4C 9C 2C 0A EE 5A CF 51 64 01 04 12 64
0110 | DD AA 86 0B 19 6E 7D 36 E1 E1 6C A0 45 C3 8C F4 0110 | C0 47 F3 39 D0 3A 60 32 9C 20 EE FF 38 F6 C2 D3
0120 | 84 FA D5 E9 74 B6 79 A8 99 EB 56 3E 69 BE C0 9B</code></pre> 0120 | 24 DE ED 38 07 C8 BE 0B 2C 6C 01 3A E1 4F 40 B9</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 = BA0D89B5AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB28
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>4, 16</td> <td>4, 16</td>
<td><code>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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>2FC97BB4A7294A978D2218F039ECB286</code></td> <td><code>BD909B93BEF0961A95C6375AD6CF6EB5</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>FE00010026F04C7F105FAB7CEC3327DC</code> <code>AE6FB808E4BD2CF11C4FA238D9B7028D</code> <code>7C694E44289ABA0029FAF7F54CFE8919</code> <code>E9B2F07AA04952BE59BDC68516E66103</code> <code>82816B13B109D8FB0124A4C45CD7E795</code> <code>3F300D650EE3092B1E952BD9A9E9EBD5</code> <code>5CCA88E3C62FAA80081511239B0FDC21</code> <code>D58DE71CAD8136C5BB2CE8B45806F091</code> <code>AFA91EBAD69D195C1724C1197768F65C</code> <code>AC1D3A3C0B8B3C3E21A555F2F92CD81B</code> <code>8326B54CF871ED06ECEBFA86D31B3018</code> <code>92122490588DDFBBF07C5920EBA3913A</code> <code>CD72C3D142F7A8A95B08FAE2F05742A9</code> <code>A5DC0B53CC9B90D85921C13F0DE18538</code> <code>152EDCF6DDAA860B196E7D36E1E16CA0</code> <code>45C38CF484FAD5E974B679A899EB563E</code><br> <code>69BEC09B</code></td> <td><code>FE0001003C3BB4E4EABA39BC1998EC5F</code> <code>9678B04B287EEA079DBD277A727BB453</code> <code>DB1A3CFE6AA62178E3269DD6B3045F65</code> <code>EDC6D5D741A29EF8B098B914D07B2E65</code> <code>B556EAD4BDECA732A609C0C537616DB5</code> <code>E9995031FE5BCFBE3A9C9619995AC094</code> <code>D3A141987DC37FF28D0544D8D4D3FF12</code> <code>3CD43A1B337077B1680D0B3CED329447</code> <code>D16B8A48916791567473277F78919CC2</code> <code>EBEA41351E7DFA3BB9F041026996F6C9</code> <code>59268CFEA786A5158A9F1D1A59F5BB43</code> <code>852479AC3CFB5CA59DF5FD6627867C81</code> <code>D6E4524A0A2C8228A4E645CD5680CF3B</code> <code>74CD1D484F33FB4C9C2C0AEE5ACF5164</code> <code>01041264C047F339D03A60329C20EEFF</code> <code>38F6C2D324DEED3807C8BE0B2C6C013A</code><br> <code>E14F40B9</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 = BA0D89B5AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB28
<!-- 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 = 54B64366AE3C4B5C6F3C2B0D7D272F733E43D7162FC97BB4A7294A978D2218F039ECB2860000000000000000FE00010026F04C7F105FAB7CEC3327DCAE6FB808E4BD2CF11C4FA238D9B7028D7C694E44289ABA0029FAF7F54CFE8919E9B2F07AA04952BE59BDC68516E6610382816B13B109D8FB0124A4C45CD7E7953F300D650EE3092B1E952BD9A9E9EBD55CCA88E3C62FAA80081511239B0FDC21D58DE71CAD8136C5BB2CE8B45806F091AFA91EBAD69D195C1724C1197768F65CAC1D3A3C0B8B3C3E21A555F2F92CD81B8326B54CF871ED06ECEBFA86D31B301892122490588DDFBBF07C5920EBA3913ACD72C3D142F7A8A95B08FAE2F05742A9A5DC0B53CC9B90D85921C13F0DE18538152EDCF6DDAA860B196E7D36E1E16CA045C38CF484FAD5E974B679A899EB563E69BEC09B <pre><code>data = 54B643669BDE3C06C0EF93D972AF7200A0EAF5ABBD909B93BEF0961A95C6375AD6CF6EB50000000000000000FE0001003C3BB4E4EABA39BC1998EC5F9678B04B287EEA079DBD277A727BB453DB1A3CFE6AA62178E3269DD6B3045F65EDC6D5D741A29EF8B098B914D07B2E65B556EAD4BDECA732A609C0C537616DB5E9995031FE5BCFBE3A9C9619995AC094D3A141987DC37FF28D0544D8D4D3FF123CD43A1B337077B1680D0B3CED329447D16B8A48916791567473277F78919CC2EBEA41351E7DFA3BB9F041026996F6C959268CFEA786A5158A9F1D1A59F5BB43852479AC3CFB5CA59DF5FD6627867C81D6E4524A0A2C8228A4E645CD5680CF3B74CD1D484F33FB4C9C2C0AEE5ACF516401041264C047F339D03A60329C20EEFF38F6C2D324DEED3807C8BE0B2C6C013AE14F40B9
padding = 2E6CA76A6788CA7CCE0B19E7 padding = 8F6DE24A7AA3B5EE1B038467
tmp_aes_key = BC4BB4D5C4F912636BB5A3D4219F1925CD6E756F9E6725E97483C3DE053BFF5D tmp_aes_key = 402A22230C9BB7E1AAF6E978F76FCF6E641F1B62DBCA2BF60FC95A1BAD45F56C
tmp_aes_iv = A13FE055E9216E10852EEAEA353FBA643B7F0ACA7980AE2C20635707931C0118</code></pre> tmp_aes_iv = C4BAAC5594932970391D732F1FF2A0CCDBB82F8CC63F5D5BB844A9234D3E1A6F</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 = 4EDF0BAB91AB5250729778E446C83E3B4B9FFFB4E473148C1B7382F52140C891D19A941F04F8AB07F86862C0B5F265BEAFFC6A381D4B0BAE9D7D026C5CD6A7436CEDA5E97D66857B4431731217196393D117D773A78816CFC381FF1AE01E5921EF1A43ABBD905CCF7E2F850455CAAC4F586A619016FFF25F8FDD47EC21D404E81E85A93FB194E96414FEF6EDC009E3E61E19BEB666B7EBD591605F2F84428C2A83AA57CE5CC6A4C4E9DA0442ECB633507997ECC35D5D9D996529A81AA6C6D64D39CE715B1B2261D972061053BD14EA3473CD1F3F089A286B8D9AF99A8FDEDC9FBE969EBEB8FFCC8E21579E27BB5FA5DE0DACD3BB76003CAC1E17562F786C3D4B420864F83789EFE5DE3CF2A81954974E3ACE2EB9E51736B6628A7308DB51DBA78F252C96FD7876D8008B45DCB1CD4DEE41045DC98405C62A544E5C9B12C53EC035AF2EF3B628D90050DCBFE28BD57D08</code></pre> <pre><code>encrypted_data = CE240137B24A93AE76D0C04F93324AEFF69599DA627DAD709B13D94B611018AA67715A576F041DB9E5E84378C2B6DDC8C3CF7B58E2DB9812F71C35137248ED5575B57D14780694B14CEC2B3DAC60612BC07232929E93B1F32F3AB49096BB27282224BD180B07E3D274BB7BCFF7063CF55347B798D45F771AD5A6BF6052918082396CDE82EF3719C80BAC18BEA096AB59A8B707242BB0315FF81AFE0A08F9D47C7B7236A5C67D4F98C4514BD3F7DCF301BB1DA4A7DDE5138BBC2451FD2513A33FD21D4C52D5F0250CFB50173192AF10C8BF347F6CB44B43A504C4010E25242B082FCBCC04AF5BE1BA881AC97BD3F4E9C82C734CD14B731B3324E2FAE62203AC2B28E0956C7EBE30AD0B59A5AB983E32127CB78105AF487A258BA69D9F098AFED871CFAD0AFBDB3D3FF67B69875A716CBE3413ECCC3A1E9ECB0304DABCA8B7699667EEAE1847755EA892579E60F62A04EC</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 B0 88 09 00 8A FB 97 66 <pre><code>0000 | 00 00 00 00 00 00 00 00 CC FA 0C 00 BB FB 97 66
0010 | 78 01 00 00 1F 5F 04 F5 AE 3C 4B 5C 6F 3C 2B 0D 0010 | 78 01 00 00 1F 5F 04 F5 9B DE 3C 06 C0 EF 93 D9
0020 | 7D 27 2F 73 3E 43 D7 16 2F C9 7B B4 A7 29 4A 97 0020 | 72 AF 72 00 A0 EA F5 AB BD 90 9B 93 BE F0 96 1A
0030 | 8D 22 18 F0 39 EC B2 86 FE 50 01 00 4E DF 0B AB 0030 | 95 C6 37 5A D6 CF 6E B5 FE 50 01 00 CE 24 01 37
0040 | 91 AB 52 50 72 97 78 E4 46 C8 3E 3B 4B 9F FF B4 0040 | B2 4A 93 AE 76 D0 C0 4F 93 32 4A EF F6 95 99 DA
0050 | E4 73 14 8C 1B 73 82 F5 21 40 C8 91 D1 9A 94 1F 0050 | 62 7D AD 70 9B 13 D9 4B 61 10 18 AA 67 71 5A 57
0060 | 04 F8 AB 07 F8 68 62 C0 B5 F2 65 BE AF FC 6A 38 0060 | 6F 04 1D B9 E5 E8 43 78 C2 B6 DD C8 C3 CF 7B 58
0070 | 1D 4B 0B AE 9D 7D 02 6C 5C D6 A7 43 6C ED A5 E9 0070 | E2 DB 98 12 F7 1C 35 13 72 48 ED 55 75 B5 7D 14
0080 | 7D 66 85 7B 44 31 73 12 17 19 63 93 D1 17 D7 73 0080 | 78 06 94 B1 4C EC 2B 3D AC 60 61 2B C0 72 32 92
0090 | A7 88 16 CF C3 81 FF 1A E0 1E 59 21 EF 1A 43 AB 0090 | 9E 93 B1 F3 2F 3A B4 90 96 BB 27 28 22 24 BD 18
00A0 | BD 90 5C CF 7E 2F 85 04 55 CA AC 4F 58 6A 61 90 00A0 | 0B 07 E3 D2 74 BB 7B CF F7 06 3C F5 53 47 B7 98
00B0 | 16 FF F2 5F 8F DD 47 EC 21 D4 04 E8 1E 85 A9 3F 00B0 | D4 5F 77 1A D5 A6 BF 60 52 91 80 82 39 6C DE 82
00C0 | B1 94 E9 64 14 FE F6 ED C0 09 E3 E6 1E 19 BE B6 00C0 | EF 37 19 C8 0B AC 18 BE A0 96 AB 59 A8 B7 07 24
00D0 | 66 B7 EB D5 91 60 5F 2F 84 42 8C 2A 83 AA 57 CE 00D0 | 2B B0 31 5F F8 1A FE 0A 08 F9 D4 7C 7B 72 36 A5
00E0 | 5C C6 A4 C4 E9 DA 04 42 EC B6 33 50 79 97 EC C3 00E0 | C6 7D 4F 98 C4 51 4B D3 F7 DC F3 01 BB 1D A4 A7
00F0 | 5D 5D 9D 99 65 29 A8 1A A6 C6 D6 4D 39 CE 71 5B 00F0 | DD E5 13 8B BC 24 51 FD 25 13 A3 3F D2 1D 4C 52
0100 | 1B 22 61 D9 72 06 10 53 BD 14 EA 34 73 CD 1F 3F 0100 | D5 F0 25 0C FB 50 17 31 92 AF 10 C8 BF 34 7F 6C
0110 | 08 9A 28 6B 8D 9A F9 9A 8F DE DC 9F BE 96 9E BE 0110 | B4 4B 43 A5 04 C4 01 0E 25 24 2B 08 2F CB CC 04
0120 | B8 FF CC 8E 21 57 9E 27 BB 5F A5 DE 0D AC D3 BB 0120 | AF 5B E1 BA 88 1A C9 7B D3 F4 E9 C8 2C 73 4C D1
0130 | 76 00 3C AC 1E 17 56 2F 78 6C 3D 4B 42 08 64 F8 0130 | 4B 73 1B 33 24 E2 FA E6 22 03 AC 2B 28 E0 95 6C
0140 | 37 89 EF E5 DE 3C F2 A8 19 54 97 4E 3A CE 2E B9 0140 | 7E BE 30 AD 0B 59 A5 AB 98 3E 32 12 7C B7 81 05
0150 | E5 17 36 B6 62 8A 73 08 DB 51 DB A7 8F 25 2C 96 0150 | AF 48 7A 25 8B A6 9D 9F 09 8A FE D8 71 CF AD 0A
0160 | FD 78 76 D8 00 8B 45 DC B1 CD 4D EE 41 04 5D C9 0160 | FB DB 3D 3F F6 7B 69 87 5A 71 6C BE 34 13 EC CC
0170 | 84 05 C6 2A 54 4E 5C 9B 12 C5 3E C0 35 AF 2E F3 0170 | 3A 1E 9E CB 03 04 DA BC A8 B7 69 96 67 EE AE 18
0180 | B6 28 D9 00 50 DC BF E2 8B D5 7D 08</code></pre> 0180 | 47 75 5E A8 92 57 9E 60 F6 2A 04 EC</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>B08809008AFB9766</code></td> <td><code>CCFA0C00BBFB9766</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>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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>2FC97BB4A7294A978D2218F039ECB286</code></td> <td><code>BD909B93BEF0961A95C6375AD6CF6EB5</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>FE5001004EDF0BAB91AB5250729778E4</code> <code>46C83E3B4B9FFFB4E473148C1B7382F5</code> <code>2140C891D19A941F04F8AB07F86862C0</code> <code>B5F265BEAFFC6A381D4B0BAE9D7D026C</code> <code>5CD6A7436CEDA5E97D66857B44317312</code> <code>17196393D117D773A78816CFC381FF1A</code> <code>E01E5921EF1A43ABBD905CCF7E2F8504</code> <code>55CAAC4F586A619016FFF25F8FDD47EC</code> <code>21D404E81E85A93FB194E96414FEF6ED</code> <code>C009E3E61E19BEB666B7EBD591605F2F</code> <code>84428C2A83AA57CE5CC6A4C4E9DA0442</code> <code>ECB633507997ECC35D5D9D996529A81A</code> <code>A6C6D64D39CE715B1B2261D972061053</code> <code>BD14EA3473CD1F3F089A286B8D9AF99A</code> <code>8FDEDC9FBE969EBEB8FFCC8E21579E27</code> <code>BB5FA5DE0DACD3BB76003CAC1E17562F</code> <code>786C3D4B420864F83789EFE5DE3CF2A8</code> <code>1954974E3ACE2EB9E51736B6628A7308</code> <code>DB51DBA78F252C96FD7876D8008B45DC</code> <code>B1CD4DEE41045DC98405C62A544E5C9B</code> <code>12C53EC035AF2EF3B628D90050DCBFE2</code><br> <code>8BD57D08</code></td> <td><code>FE500100CE240137B24A93AE76D0C04F</code> <code>93324AEFF69599DA627DAD709B13D94B</code> <code>611018AA67715A576F041DB9E5E84378</code> <code>C2B6DDC8C3CF7B58E2DB9812F71C3513</code> <code>7248ED5575B57D14780694B14CEC2B3D</code> <code>AC60612BC07232929E93B1F32F3AB490</code> <code>96BB27282224BD180B07E3D274BB7BCF</code> <code>F7063CF55347B798D45F771AD5A6BF60</code> <code>52918082396CDE82EF3719C80BAC18BE</code> <code>A096AB59A8B707242BB0315FF81AFE0A</code> <code>08F9D47C7B7236A5C67D4F98C4514BD3</code> <code>F7DCF301BB1DA4A7DDE5138BBC2451FD</code> <code>2513A33FD21D4C52D5F0250CFB501731</code> <code>92AF10C8BF347F6CB44B43A504C4010E</code> <code>25242B082FCBCC04AF5BE1BA881AC97B</code> <code>D3F4E9C82C734CD14B731B3324E2FAE6</code> <code>2203AC2B28E0956C7EBE30AD0B59A5AB</code> <code>983E32127CB78105AF487A258BA69D9F</code> <code>098AFED871CFAD0AFBDB3D3FF67B6987</code> <code>5A716CBE3413ECCC3A1E9ECB0304DABC</code> <code>A8B7699667EEAE1847755EA892579E60</code><br> <code>F62A04EC</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 = 3A9004900BD0727B577AE5A980CB926FDAE8AB789393017A2A7ECC8B827AF8A29F79E2CE69C72B069F72A26102FE0CBC41AE02B769280A03E63A9B4EFB041229945F199616E91CD263BD6DFC3F5E65C72699718345E398ED51D76661BD5229AAED89EB1265621785A041F2F4CCF5640A741358B6A222F60B00A10C2944BA02DCDEF2E745D70FC1D2B44356C2C2C955D597E5BEBB8FA1DAF49C7A8458431BFB4AD058288475E594237D5F4421FAB8BC8DC62425AE03BBA715841B4B34660BBDEF30179AA114526AD0A7208A659068DA900FEF9EA1C07ACEC2E1DE571832BF4D4DD18D865E47E4DF517BEB55107C371F84FEDD78CE779681D0D4C97A1CBE3A68D6</code></pre> <pre><code>auth_key = 4A0C761FAB31351AD267B26423AEBE448D930CF1B5C19EBCC52CCBE6D4ADDEE159F2BB5029327012AF93E4CE200F411C70EBAD273045597698C376FC42E4A166AF2555B50BBAA5CFA06A0FB2480DC63F781E790D310D43A5A72FEFEDBF3B6FF74C98E7D16E79974044D11226231A840F726F76ED7B99BA8EDBEE804855D00A976EE6B61FE445B2DBF3738F6065D7977C53AF1B57543129BCA14B152DB1E134AFCD2F361E40AF6C2A38D73727A02E5EE03E2197BCF6ACAB90066CCABB24A031E9259E033EC57F20D84C550A325493E85CF0EE745D483F0CE6065F1E71CF259ED89EA8F17E93237321BC04B0A1339B6FD57BD73AD54D06326A9599DE93F30F618F</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 FC 99 FE 8A FB 97 66 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 F4 C0 07 BC FB 97 66
0010 | 90 00 00 00 34 F7 CB 3B AE 3C 4B 5C 6F 3C 2B 0D 0010 | 6C 00 00 00 34 F7 CB 3B 9B DE 3C 06 C0 EF 93 D9
0020 | 7D 27 2F 73 3E 43 D7 16 2F C9 7B B4 A7 29 4A 97 0020 | 72 AF 72 00 A0 EA F5 AB BD 90 9B 93 BE F0 96 1A
0030 | 8D 22 18 F0 39 EC B2 86 7F 18 82 EA A8 E0 08 35 0030 | 95 C6 37 5A D6 CF 6E B5 03 50 4F 6F 45 00 D7 AE
0040 | 93 39 C3 53 51 A9 7D 9F</code></pre> 0040 | 17 0C 71 EE 2E 61 36 6C</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>01FC99FE8AFB9766</code></td> <td><code>01F4C007BCFB9766</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>90000000</code> (144 in decimal)</td> <td><code>6C000000</code> (108 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>AE3C4B5C6F3C2B0D7D272F733E43D716</code></td> <td><code>9BDE3C06C0EF93D972AF7200A0EAF5AB</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>2FC97BB4A7294A978D2218F039ECB286</code></td> <td><code>BD909B93BEF0961A95C6375AD6CF6EB5</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>7F1882EAA8E008359339C35351A97D9F</code></td> <td><code>03504F6F4500D7AE170C71EE2E61366C</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>