Update content of files

This commit is contained in:
GitHub Action 2023-10-24 19:55:00 +00:00
parent 0b984f9bbc
commit b748c12cb3
7 changed files with 527 additions and 213 deletions

View file

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Block</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Working with the blocklist.
Scheme:
peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
contacts.blocked#ade1591…">
<meta property="og:title" content="Block">
<meta property="og:image" content="">
<meta property="og:description" content="Working with the blocklist.
Scheme:
peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
contacts.blocked#ade1591…">
<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?236" 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/block" >Block</a></li></ul></div>
<h1 id="dev_page_title">Block</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Working with the blocklist.</p>
<p>Scheme:</p>
<pre><code><a href='/constructor/peerBlocked'>peerBlocked</a>#e8fd8014 peer_id:<a href='/type/Peer'>Peer</a> date:<a href='/type/int'>int</a> = <a href='/type/PeerBlocked'>PeerBlocked</a>;
<a href='/constructor/contacts.blocked'>contacts.blocked</a>#ade1591 blocked:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PeerBlocked'>PeerBlocked</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/contacts.Blocked'>contacts.Blocked</a>;
<a href='/constructor/updatePeerBlocked'>updatePeerBlocked</a>#ebe07752 flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.1?<a href='/constructor/true'>true</a> peer_id:<a href='/type/Peer'>Peer</a> = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/contacts.block'>contacts.block</a>#2e2e8734 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/contacts.unblock'>contacts.unblock</a>#b550d328 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/contacts.getBlocked'>contacts.getBlocked</a>#9a868f80 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/contacts.Blocked'>contacts.Blocked</a>;
<a href='/method/contacts.setBlocked'>contacts.setBlocked</a>#94c65c76 flags:<a href='/type/%23'>#</a> my_stories_from:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPeer'>InputPeer</a>&gt; limit:<a href='/type/int'>int</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Use <a href="/method/contacts.block">contacts.block</a> and <a href="/method/contacts.unblock">contacts.unblock</a> to block and unblock peers. </p>
<p>If the <code>my_stories_from</code> is set, peers will be added/removed only to/from the story blocklist; otherwise, they will be added/removed to/from the the main blocklist. </p>
<p>Peers in the story blocklist won't be able view your <a href="/api/stories">stories</a>.<br>
Peers in the main blocklist won't be able to write messages to you, view your status, photo and stories. </p>
<p>Adding or removing a peer from a blocklist will emit an <a href="/constructor/updatePeerBlocked">updatePeerBlocked</a> to all currenly logged-in sessions (the peer we blocked/unblocked <em>won't</em> receive any update). </p>
<p>Use <a href="/method/contacts.getBlocked">contacts.getBlocked</a> to fetch the list of blocked peers; as usual, the <code>my_stories_from</code> flag can be used to fetch the story blocklist or the main blocklist, and the <code>offset</code>/<code>limit</code> parameters are used for <a href="/api/offsets">pagination »</a>. </p>
<p><a href="/method/contacts.setBlocked">contacts.setBlocked</a> may also be used to completely replace the contents of an entire blocklist in bulk: just pass the blocklist type in <code>my_stories_from</code>, the full list of IDs to block in <code>id</code> and the length of the list passed to <code>id</code> in <code>limit</code>: the server will completely replace the specified blocklist.</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

@ -0,0 +1,158 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Nearby</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="How to work with geolocation-based features like geochats and the nearby users feature.
Fetching nearby users &amp; geogroups…">
<meta property="og:title" content="Nearby">
<meta property="og:image" content="">
<meta property="og:description" content="How to work with geolocation-based features like geochats and the nearby users feature.
Fetching nearby users &amp; geogroups…">
<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?236" 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/nearby" >Nearby</a></li></ul></div>
<h1 id="dev_page_title">Nearby</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>How to work with geolocation-based features like geochats and the nearby users feature.</p>
<h2><a class="anchor" href="#fetching-nearby-users--geogroups" id="fetching-nearby-users--geogroups" name="fetching-nearby-users--geogroups"><i class="anchor-icon"></i></a>Fetching nearby users &amp; geogroups</h2>
<pre><code><a href='/constructor/inputGeoPoint'>inputGeoPoint</a>#48222faf flags:<a href='/type/%23'>#</a> lat:<a href='/type/double'>double</a> long:<a href='/type/double'>double</a> accuracy_radius:flags.0?<a href='/type/int'>int</a> = <a href='/type/InputGeoPoint'>InputGeoPoint</a>;
---functions---
<a href='/method/contacts.getLocated'>contacts.getLocated</a>#d348bc44 flags:<a href='/type/%23'>#</a> background:flags.1?<a href='/constructor/true'>true</a> geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> self_expires:flags.0?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Use <a href="/method/contacts.getLocated">contacts.getLocated</a> to fetch a list of nearby users and groups. </p>
<p>Do <strong>not</strong> set any of the <code>background</code>, <code>self_expires</code> flags: only populate <code>geo_point</code> with the current geolocation of the user: a list of users and geochats located nearby will be returned. </p>
<p>This functionality is useful for example to <a href="/api/contacts#adding-telegram-users-as-contacts">exchange contacts</a> with a nearby Telegram user, or <a href="/method/channels.joinChannel">join</a> a location-based group chat, see <a href="https://telegram.org/blog/contacts-local-groups">here »</a> for more usecases. </p>
<p>See <a href="#creating-a-geogroup">here »</a> for more info on how to create a geogroup, and <a href="#advertising-our-current-location">here »</a> for more info on how to advertise our current location to other users. </p>
<h2><a class="anchor" href="#creating-a-geogroup" id="creating-a-geogroup" name="creating-a-geogroup"><i class="anchor-icon"></i></a>Creating a geogroup</h2>
<pre><code><a href='/constructor/inputGeoPoint'>inputGeoPoint</a>#48222faf flags:<a href='/type/%23'>#</a> lat:<a href='/type/double'>double</a> long:<a href='/type/double'>double</a> accuracy_radius:flags.0?<a href='/type/int'>int</a> = <a href='/type/InputGeoPoint'>InputGeoPoint</a>;
---functions---
<a href='/method/channels.createChannel'>channels.createChannel</a>#91006707 flags:<a href='/type/%23'>#</a> broadcast:flags.0?<a href='/constructor/true'>true</a> megagroup:flags.1?<a href='/constructor/true'>true</a> for_import:flags.3?<a href='/constructor/true'>true</a> forum:flags.5?<a href='/constructor/true'>true</a> title:<a href='/type/string'>string</a> about:<a href='/type/string'>string</a> geo_point:flags.2?<a href='/type/InputGeoPoint'>InputGeoPoint</a> address:flags.2?<a href='/type/string'>string</a> ttl_period:flags.4?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/channels.editLocation'>channels.editLocation</a>#58e63f6d channel:<a href='/type/InputChannel'>InputChannel</a> geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> address:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Pass a <code>geo_point</code> to <a href="/method/channels.createChannel">channels.createChannel</a> when creating a <a href="/api/channel">supergroup</a> in order to create a geogroup associated to a geolocation, that will be returned to <a href="#fetching-nearby-users--geogroups">nearby users »</a>. </p>
<p>A textual description of the location (1-64 UTF-8 chars) should also be passed in <code>address</code>. </p>
<p>Use <a href="/method/channels.editLocation">channels.editLocation</a> to change the group's location.</p>
<h2><a class="anchor" href="#advertising-our-current-location" id="advertising-our-current-location" name="advertising-our-current-location"><i class="anchor-icon"></i></a>Advertising our current location</h2>
<pre><code><a href='/constructor/inputGeoPoint'>inputGeoPoint</a>#48222faf flags:<a href='/type/%23'>#</a> lat:<a href='/type/double'>double</a> long:<a href='/type/double'>double</a> accuracy_radius:flags.0?<a href='/type/int'>int</a> = <a href='/type/InputGeoPoint'>InputGeoPoint</a>;
---functions---
<a href='/method/contacts.getLocated'>contacts.getLocated</a>#d348bc44 flags:<a href='/type/%23'>#</a> background:flags.1?<a href='/constructor/true'>true</a> geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> self_expires:flags.0?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Our current location may be <a href="#fetching-nearby-users--geogroups">advertised to other users</a> using <a href="/method/contacts.getLocated">contacts.getLocated</a>: in this case the <code>self_expires</code> flag <strong>must always be set</strong>.</p>
<p>This flag is used to specify the expiration TTL of the passed geolocation (i.e. the geolocation will expire after <code>self_expires</code> seconds); pass `0x7fffffff`` to disable expiry, 0 to make the current geolocation private. </p>
<p>The method will also return a list of nearby users and chats, but only if the passed expiration TTL is not equal to zero.<br>
Users may still fetch nearby users and chats without making their geolocation public by simply not setting the flag, see <a href="#fetching-nearby-users--geogroups">here »</a> for more info. </p>
<p>While the geolocation of the current user is public, clients should update it in the background every half-an-hour or so (or in any case before the expiration date specified with <code>self_expires</code>), while setting this flag. </p>
<p>If the new location is more than 1 KM away from the previous one, or if the previous location is unknown, the <code>background</code> flag should be set when invoking <a href="/method/contacts.getLocated">contacts.getLocated</a>.</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

@ -177,6 +177,8 @@
<p>Import chat history from a foreign chat app into a specific Telegram chat, <a href="/api/import">click here for more info about imported chats »</a>.</p>
<h4><a class="anchor" href="#forums" id="forums" name="forums"><i class="anchor-icon"></i></a><a href="/api/forum">Forums</a></h4>
<p>Telegram allows creating forums with multiple distinct topics.</p>
<h4><a class="anchor" href="#nearby-userschats" id="nearby-userschats" name="nearby-userschats"><i class="anchor-icon"></i></a><a href="/api/nearby">Nearby users&amp;chats</a></h4>
<p>How to work with geolocation-based features like geochats and the nearby users feature.</p>
<h4><a class="anchor" href="#messagessetdefaulthistoryttl" id="messagessetdefaulthistoryttl" name="messagessetdefaulthistoryttl"><i class="anchor-icon"></i></a><a href="/method/messages.setDefaultHistoryTTL">messages.setDefaultHistoryTTL</a></h4>
<p>Changes the default value of the Time-To-Live setting, applied to all new chats.</p></div>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>contacts.block</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Adds the user to the blacklist.">
<meta property="description" content="Adds a peer to a blocklist, see here » for more info.">
<meta property="og:title" content="contacts.block">
<meta property="og:image" content="">
<meta property="og:description" content="Adds the user to the blacklist.">
<meta property="og:description" content="Adds a peer to a blocklist, see here » for more info.">
<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">
@ -124,7 +124,9 @@
<td>The provided peer id is invalid.</td>
</tr>
</tbody>
</table></div>
</table>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#block" id="block" name="block"><i class="anchor-icon"></i></a><a href="/api/block">Block</a></h4></div>
</div>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>contacts.unblock</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Deletes the user from the blacklist.">
<meta property="description" content="Deletes a peer from a blocklist, see here » for more info.">
<meta property="og:title" content="contacts.unblock">
<meta property="og:image" content="">
<meta property="og:description" content="Deletes the user from the blacklist.">
<meta property="og:description" content="Deletes a peer from a blocklist, see here » for more info.">
<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">
@ -119,7 +119,9 @@
<td>The provided peer id is invalid.</td>
</tr>
</tbody>
</table></div>
</table>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#block" id="block" name="block"><i class="anchor-icon"></i></a><a href="/api/block">Block</a></h4></div>
</div>

View file

@ -53,9 +53,9 @@
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
<!-- start req_pq_multi -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 CC A8 02 00 7A 53 34 65
0010 | 14 00 00 00 F1 8E 7E BE 7B CB 07 77 D6 CA 0B 09
0020 | 19 33 62 DB 79 65 57 9A</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 CC CE 0A 00 F7 1E 38 65
0010 | 14 00 00 00 F1 8E 7E BE 80 79 E1 6E 86 7B C4 82
0020 | F9 B4 8E 24 88 E9 54 B3</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
<table class="table">
@ -77,7 +77,7 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>CCA802007A533465</code></td>
<td><code>CCCE0A00F71E3865</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -95,7 +95,7 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,11 +104,11 @@
<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5>
<!-- start resPQ -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 F4 F0 3C 78 53 34 65
0010 | A4 00 00 00 63 24 16 05 7B CB 07 77 D6 CA 0B 09
0020 | 19 33 62 DB 79 65 57 9A 85 1D 93 2F 9A C4 67 82
0030 | 4C 26 4C 84 57 80 B1 0A 08 15 29 F7 C3 71 46 1E
0040 | 91 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A8 36 D7 F2 1E 38 65
0010 | 58 00 00 00 63 24 16 05 80 79 E1 6E 86 7B C4 82
0020 | F9 B4 8E 24 88 E9 54 B3 AF 73 D5 1E 13 D1 A9 25
0030 | 59 21 3C 56 96 1D 02 F8 08 27 CD 14 EF 69 B2 A0
0040 | 97 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
0060 | 85 1D 9D D0</code></pre>
<p>Payload (de)serialization:</p>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01F4F03C78533465</code></td>
<td><code>01A836D7F21E3865</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>A4000000</code> (164 in decimal)</td>
<td><code>58000000</code> (88 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>851D932F9AC467824C264C845780B10A</code></td>
<td><code>AF73D51E13D1A92559213C56961D02F8</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081529F7C371461E91000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1525022367632727697</td>
<td><code>0827CD14EF69B2A097000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2867971556207927447</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -208,22 +208,22 @@
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<!-- start pq -->
<pre><code>pq = 1525022367632727697</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1525022367632727697 = 1100682553 * 1385524249</code></p>
<pre><code>p = 1100682553
q = 1385524249</code></pre>
<pre><code>pq = 2867971556207927447</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2867971556207927447 = 1536892391 * 1866084817</code></p>
<pre><code>p = 1536892391
q = 1866084817</code></pre>
<!-- end pq -->
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
<!-- start p_q_inner_data_dc -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 95 5F F5 A9 08 15 29 F7 C3 71 46 1E 91 00 00 00
0010 | 04 41 9B 15 39 00 00 00 04 52 95 6C 19 00 00 00
0020 | 7B CB 07 77 D6 CA 0B 09 19 33 62 DB 79 65 57 9A
0030 | 85 1D 93 2F 9A C4 67 82 4C 26 4C 84 57 80 B1 0A
0040 | DC 87 36 8B 3B 05 2D 4E DD 4E 8D A2 3A D5 31 22
0050 | 54 C6 90 6F 84 A3 40 51 0E AA 14 B2 59 58 72 67
<pre><code>0000 | 95 5F F5 A9 08 27 CD 14 EF 69 B2 A0 97 00 00 00
0010 | 04 5B 9B 1D E7 00 00 00 04 6F 3A 31 D1 00 00 00
0020 | 80 79 E1 6E 86 7B C4 82 F9 B4 8E 24 88 E9 54 B3
0030 | AF 73 D5 1E 13 D1 A9 25 59 21 3C 56 96 1D 02 F8
0040 | 12 93 82 9C F9 BA 13 56 3D 7D 8B B1 30 85 16 0F
0050 | 12 F8 9F BB 40 A1 DB 01 81 54 D5 FB 0F 49 E1 C0
0060 | 02 00 00 00</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;</code></pre>
@ -246,37 +246,37 @@ q = 1385524249</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081529F7C371461E91000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1525022367632727697</td>
<td><code>0827CD14EF69B2A097000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2867971556207927447</td>
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>p</td>
<td>16, 8</td>
<td><code>04419B1539000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1100682553</td>
<td><code>045B9B1DE7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1536892391</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>24, 8</td>
<td><code>0452956C19000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1385524249</td>
<td><code>046F3A31D1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1866084817</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>nonce</td>
<td>32, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>851D932F9AC467824C264C845780B10A</code></td>
<td><code>AF73D51E13D1A92559213C56961D02F8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>DC87368B3B052D4EDD4E8DA23AD53122</code> <code>54C6906F84A340510EAA14B259587267</code></td>
<td><code>1293829CF9BA13563D7D8BB13085160F</code> <code>12F89FBB40A1DB018154D5FB0F49E1C0</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1385524249</code></pre>
<p>The serialization of <em>P_Q_inner_data</em> produces <strong>data</strong>, which is used to generate <strong>encrypted_data</strong> as specified in <a href="/mtproto/auth_key">step 4.1</a>.<br>
These are the inputs to the algorithm specified in <a href="/mtproto/auth_key">step 4.1</a>:</p>
<!-- start p_q_inner_data_input -->
<pre><code>data = 955FF5A9081529F7C371461E9100000004419B15390000000452956C190000007BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10ADC87368B3B052D4EDD4E8DA23AD5312254C6906F84A340510EAA14B25958726702000000
random_padding_bytes = DF354798C82F052E630CE189EF0680BABDC2A6AC2F20E1A5A0C4574F9FF8D9A18F2902A9DBBA7B734906E0471583F1A5761AAA3A4FBB13DBE4B28FB670925D98E8498F7BC2301CF24FA8293364B8789066C4DA84CBE4AEB60FF86AFB</code></pre>
<pre><code>data = 955FF5A90827CD14EF69B2A097000000045B9B1DE7000000046F3A31D10000008079E16E867BC482F9B48E2488E954B3AF73D51E13D1A92559213C56961D02F81293829CF9BA13563D7D8BB13085160F12F89FBB40A1DB018154D5FB0F49E1C002000000
random_padding_bytes = 4152FDA2C238E2874D9E0FADFE547195489786640FDCBF7AEC9AEFD1856B522A66588C59C98F6EE1DDA6957F8245529139DDD320D3E0BCA8AF412B97C4D50B4352D83BD3D57DCE3C81B6716E32EB46CD47696FAAAD1B345D4F275B70</code></pre>
<!-- end p_q_inner_data_input -->
<p>And this is the output:</p>
<!-- start p_q_inner_data_output -->
<pre><code>encrypted_data = E642F147A5C54098736919E04E797E47674D1939E64C508B2B5EAF1CC4229461F39D6B1AF4C164293BCF1B11ACCF8C121EE14401100FA97909CB8E2353AE3ED72D3FDD0D44002048DA6C5B128382BE16C98AB6774BAC8A4B2E27CE22301C34698E7A4491A17275FB8DED62748FEAE15A25B351E41636C3AA508182AC838CF8D02D092E131365B8F188570B409225263FF96115730185C2E470231629B3FF07CF67E3FE2E99BB9AB6F01307D58533BF1BD2F5C759796F6B066FFB246DF713B5445051457CD461A7A683AD6CF809C73DB631B072AA0B296CA69924EE4EE61438ACE748F78D45D2FE352370319FD0570780E6912368546D1E06E3110AA7CE412300</code></pre>
<pre><code>encrypted_data = 82173D59A38D252E539A2D5AD472A3844B56759CD56D4DC6BC4F8F9CD99E9E82BA5E15B9D2BFAAFCEFAB14F7C11A1095FB38069983B436C7BA43F7A3CFB9726FFF3D7A42D6053D8EF484DDEB7960498CBDAE44E31D460D02356C4334072D174A28CD00353C0C5BE53C615CBC5E780CD3DC370AA987E71AE44F9406C0F1CC1782CD4B5C10CD96A67D3B0A414C2DA4DE0BBED3660A94C854D917ABB942D0F512E0A7DB2874761637FA7F25181E6E931F3A0FD2F45C68B5602EBD50FA2319D7F4841A76BE3808555D40ED962B1F0E7B7BC5D13107A64883B6654EAD1DED778BECDF5BCC89036F5175C886281A00F2A3E959EBB9C8ED42DF93713098AC2A80AC400C</code></pre>
<!-- end p_q_inner_data_output -->
<p>The length of the final string is 256 bytes.</p>
<h5><a class="anchor" href="#5-send-req-dh-params-query-with-generated-encrypted-data" id="5-send-req-dh-params-query-with-generated-encrypted-data" name="5-send-req-dh-params-query-with-generated-encrypted-data"><i class="anchor-icon"></i></a>5) Send req_DH_params query with generated <code>encrypted_data</code></h5>
<!-- start req_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 84 D3 08 00 7A 53 34 65
0010 | 40 01 00 00 BE E4 12 D7 7B CB 07 77 D6 CA 0B 09
0020 | 19 33 62 DB 79 65 57 9A 85 1D 93 2F 9A C4 67 82
0030 | 4C 26 4C 84 57 80 B1 0A 04 41 9B 15 39 00 00 00
0040 | 04 52 95 6C 19 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 E6 42 F1 47 A5 C5 40 98 73 69 19 E0
0060 | 4E 79 7E 47 67 4D 19 39 E6 4C 50 8B 2B 5E AF 1C
0070 | C4 22 94 61 F3 9D 6B 1A F4 C1 64 29 3B CF 1B 11
0080 | AC CF 8C 12 1E E1 44 01 10 0F A9 79 09 CB 8E 23
0090 | 53 AE 3E D7 2D 3F DD 0D 44 00 20 48 DA 6C 5B 12
00A0 | 83 82 BE 16 C9 8A B6 77 4B AC 8A 4B 2E 27 CE 22
00B0 | 30 1C 34 69 8E 7A 44 91 A1 72 75 FB 8D ED 62 74
00C0 | 8F EA E1 5A 25 B3 51 E4 16 36 C3 AA 50 81 82 AC
00D0 | 83 8C F8 D0 2D 09 2E 13 13 65 B8 F1 88 57 0B 40
00E0 | 92 25 26 3F F9 61 15 73 01 85 C2 E4 70 23 16 29
00F0 | B3 FF 07 CF 67 E3 FE 2E 99 BB 9A B6 F0 13 07 D5
0100 | 85 33 BF 1B D2 F5 C7 59 79 6F 6B 06 6F FB 24 6D
0110 | F7 13 B5 44 50 51 45 7C D4 61 A7 A6 83 AD 6C F8
0120 | 09 C7 3D B6 31 B0 72 AA 0B 29 6C A6 99 24 EE 4E
0130 | E6 14 38 AC E7 48 F7 8D 45 D2 FE 35 23 70 31 9F
0140 | D0 57 07 80 E6 91 23 68 54 6D 1E 06 E3 11 0A A7
0150 | CE 41 23 00</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D0 CE 0A 00 F7 1E 38 65
0010 | 40 01 00 00 BE E4 12 D7 80 79 E1 6E 86 7B C4 82
0020 | F9 B4 8E 24 88 E9 54 B3 AF 73 D5 1E 13 D1 A9 25
0030 | 59 21 3C 56 96 1D 02 F8 04 5B 9B 1D E7 00 00 00
0040 | 04 6F 3A 31 D1 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 82 17 3D 59 A3 8D 25 2E 53 9A 2D 5A
0060 | D4 72 A3 84 4B 56 75 9C D5 6D 4D C6 BC 4F 8F 9C
0070 | D9 9E 9E 82 BA 5E 15 B9 D2 BF AA FC EF AB 14 F7
0080 | C1 1A 10 95 FB 38 06 99 83 B4 36 C7 BA 43 F7 A3
0090 | CF B9 72 6F FF 3D 7A 42 D6 05 3D 8E F4 84 DD EB
00A0 | 79 60 49 8C BD AE 44 E3 1D 46 0D 02 35 6C 43 34
00B0 | 07 2D 17 4A 28 CD 00 35 3C 0C 5B E5 3C 61 5C BC
00C0 | 5E 78 0C D3 DC 37 0A A9 87 E7 1A E4 4F 94 06 C0
00D0 | F1 CC 17 82 CD 4B 5C 10 CD 96 A6 7D 3B 0A 41 4C
00E0 | 2D A4 DE 0B BE D3 66 0A 94 C8 54 D9 17 AB B9 42
00F0 | D0 F5 12 E0 A7 DB 28 74 76 16 37 FA 7F 25 18 1E
0100 | 6E 93 1F 3A 0F D2 F4 5C 68 B5 60 2E BD 50 FA 23
0110 | 19 D7 F4 84 1A 76 BE 38 08 55 5D 40 ED 96 2B 1F
0120 | 0E 7B 7B C5 D1 31 07 A6 48 83 B6 65 4E AD 1D ED
0130 | 77 8B EC DF 5B CC 89 03 6F 51 75 C8 86 28 1A 00
0140 | F2 A3 E9 59 EB B9 C8 ED 42 DF 93 71 30 98 AC 2A
0150 | 80 AC 40 0C</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;</code></pre>
<table class="table">
@ -345,7 +345,7 @@ random_padding_bytes = DF354798C82F052E630CE189EF0680BABDC2A6AC2F20E1A5A0C4574F9
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>84D308007A533465</code></td>
<td><code>D0CE0A00F71E3865</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -363,25 +363,25 @@ random_padding_bytes = DF354798C82F052E630CE189EF0680BABDC2A6AC2F20E1A5A0C4574F9
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>851D932F9AC467824C264C845780B10A</code></td>
<td><code>AF73D51E13D1A92559213C56961D02F8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>04419B1539000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1100682553</td>
<td><code>045B9B1DE7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1536892391</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>64, 8</td>
<td><code>0452956C19000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1385524249</td>
<td><code>046F3A31D1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1866084817</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -393,7 +393,7 @@ random_padding_bytes = DF354798C82F052E630CE189EF0680BABDC2A6AC2F20E1A5A0C4574F9
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE000100E642F147A5C54098736919E0</code> <code>4E797E47674D1939E64C508B2B5EAF1C</code> <code>C4229461F39D6B1AF4C164293BCF1B11</code> <code>ACCF8C121EE14401100FA97909CB8E23</code> <code>53AE3ED72D3FDD0D44002048DA6C5B12</code> <code>8382BE16C98AB6774BAC8A4B2E27CE22</code> <code>301C34698E7A4491A17275FB8DED6274</code> <code>8FEAE15A25B351E41636C3AA508182AC</code> <code>838CF8D02D092E131365B8F188570B40</code> <code>9225263FF96115730185C2E470231629</code> <code>B3FF07CF67E3FE2E99BB9AB6F01307D5</code> <code>8533BF1BD2F5C759796F6B066FFB246D</code> <code>F713B5445051457CD461A7A683AD6CF8</code> <code>09C73DB631B072AA0B296CA69924EE4E</code> <code>E61438ACE748F78D45D2FE352370319F</code> <code>D0570780E6912368546D1E06E3110AA7</code><br> <code>CE412300</code></td>
<td><code>FE00010082173D59A38D252E539A2D5A</code> <code>D472A3844B56759CD56D4DC6BC4F8F9C</code> <code>D99E9E82BA5E15B9D2BFAAFCEFAB14F7</code> <code>C11A1095FB38069983B436C7BA43F7A3</code> <code>CFB9726FFF3D7A42D6053D8EF484DDEB</code> <code>7960498CBDAE44E31D460D02356C4334</code> <code>072D174A28CD00353C0C5BE53C615CBC</code> <code>5E780CD3DC370AA987E71AE44F9406C0</code> <code>F1CC1782CD4B5C10CD96A67D3B0A414C</code> <code>2DA4DE0BBED3660A94C854D917ABB942</code> <code>D0F512E0A7DB2874761637FA7F25181E</code> <code>6E931F3A0FD2F45C68B5602EBD50FA23</code> <code>19D7F4841A76BE3808555D40ED962B1F</code> <code>0E7B7BC5D13107A64883B6654EAD1DED</code> <code>778BECDF5BCC89036F5175C886281A00</code> <code>F2A3E959EBB9C8ED42DF93713098AC2A</code><br> <code>80AC400C</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = DF354798C82F052E630CE189EF0680BABDC2A6AC2F20E1A5A0C4574F9
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
<!-- start server_DH_params_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 6C BE CF 78 53 34 65
0010 | D8 02 00 00 5C 07 E8 D0 7B CB 07 77 D6 CA 0B 09
0020 | 19 33 62 DB 79 65 57 9A 85 1D 93 2F 9A C4 67 82
0030 | 4C 26 4C 84 57 80 B1 0A FE 50 02 00 08 C5 C2 50
0040 | B2 28 D1 BF CA 8A 00 76 56 DB F0 13 D4 A1 DD C6
0050 | 7E C3 66 98 88 60 90 7F C2 FA 04 63 81 7C 1F F3
0060 | B0 B7 8E DF DA 10 33 1C 7C 12 AF 82 BE DC 3E 97
0070 | B4 4D 0C D0 9C 85 F2 CB CB D8 2B C5 DA F0 1C F1
0080 | 17 F9 67 32 CC 28 99 CB 53 73 E6 81 4B 6C 82 03
0090 | A0 6A DC 0E 46 C9 55 68 D5 84 12 99 A6 21 F7 27
00A0 | 6E C8 2F 9C 35 68 4B 02 7E EF 9A BA 08 EE 3A 4A
00B0 | 06 F8 48 3A 6B 85 09 60 00 D9 9A B9 C4 6E 3D 2F
00C0 | 9C 18 5C CF 58 0B DD 0B 4E 92 08 78 BD 8E 24 AA
00D0 | D5 71 7C 0A 15 C3 40 39 FA CE DE 39 88 61 16 90
00E0 | 42 4D 44 D5 46 7B 33 A7 3E 5D 9B EA 4F BD BB 0B
00F0 | 0B 16 7C 78 1F 7D 57 03 B5 04 01 DF D5 DA 39 81
0100 | 5A 50 31 8D 21 0E 5C 6A 73 7C CD 82 1A 1F 6F 22
0110 | 12 27 23 8E C7 FE F6 85 DF C5 83 F6 95 E0 8D 78
0120 | C1 DE 38 C0 8E BF 37 AC A6 CC 54 69 25 34 F9 05
0130 | FC 18 42 8B 79 D2 EE 80 44 87 5C D3 49 71 A1 6A
0140 | 5C CC D7 07 6F FB 71 3D 57 80 E1 70 93 C7 46 9B
0150 | DA 0B E7 DC 53 B3 75 A8 01 1B A7 20 77 F9 AB 2E
0160 | 97 0A F6 6E 27 04 38 7D A5 7F ED B9 3D C0 D1 43
0170 | E9 2F 6E 02 35 B5 16 29 CE A3 29 22 03 8A CD AE
0180 | 32 C7 94 E8 0D CE F7 C7 8C B3 83 C7 DA 14 BA 7B
0190 | A7 FE D2 41 BB 4E F0 7F C0 F7 12 7A FB 99 33 2F
01A0 | EE 37 57 7E 08 E1 54 00 41 EE 54 59 E3 CA 66 E4
01B0 | 0F CF 41 D8 22 5B E9 32 AE C8 DF 54 4D 97 59 24
01C0 | 1B 22 73 15 66 1C 10 A9 95 1B 39 13 A8 CF B1 BB
01D0 | C1 82 9F 30 D7 AC 8F 7E 27 E4 10 D8 B3 13 EF 8B
01E0 | 48 A9 9D 4A E5 7B 4C B8 23 4D D8 7C 6A 65 35 91
01F0 | 95 57 91 E6 F8 81 0F 10 1F 34 96 D3 D5 C0 BF 3E
0200 | A2 43 39 B5 33 6E B4 F3 4C EF C0 D5 2A B3 37 21
0210 | 65 C2 AB 87 51 98 F9 F3 A6 59 2A D0 9C 78 31 9A
0220 | D7 98 F2 57 06 AF 91 C6 BF D4 3A 1D B7 2C CF 00
0230 | 7C 4A 52 DC B1 2E F8 4C 1F 64 B2 12 D9 C4 39 64
0240 | 90 AC 98 50 09 45 A9 87 8A 24 6E AE AF E5 EF 52
0250 | 5A B6 F7 CB 24 51 93 26 0A EC 63 77 24 E9 5D B4
0260 | 4E 64 61 55 34 23 BB 4C 77 59 28 E2 2A F8 B5 EB
0270 | 91 BF 35 BE FC 13 3F A8 33 BC F9 25 83 35 94 7F
0280 | 89 19 C0 F0 23 72 D0 A6 0F 32 13 7B</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 00 89 71 F3 1E 38 65
0010 | C4 02 00 00 5C 07 E8 D0 80 79 E1 6E 86 7B C4 82
0020 | F9 B4 8E 24 88 E9 54 B3 AF 73 D5 1E 13 D1 A9 25
0030 | 59 21 3C 56 96 1D 02 F8 FE 50 02 00 EF EE F8 03
0040 | D6 35 27 21 2D 15 4C 9D 65 7B 4A C4 2D 06 88 AC
0050 | 04 06 4D B1 08 5B 51 F2 F3 0A F6 B4 D1 F9 20 9D
0060 | E8 19 A5 AD 70 0F 1C 9F DD 0B 77 CC 40 A0 43 5C
0070 | A5 39 E5 25 50 53 16 82 00 02 10 B8 94 DB D8 35
0080 | CD D4 5F A3 18 DF 68 67 B3 07 8A 24 99 D2 E0 A7
0090 | 7C 6D ED D0 F1 72 E8 D5 34 92 90 94 6C 89 57 12
00A0 | 5F D8 B9 FF E6 85 90 1B 28 96 27 5D F8 6A DF 8A
00B0 | 0B C4 0D EC 76 4C E9 95 92 32 A2 7A 7A 5D 34 EB
00C0 | 0C 31 B6 87 6A 5E 2E 7B 7F 0C 73 02 65 EE F0 87
00D0 | 7A C1 B7 32 D6 7E 57 9A CF A1 E4 F0 27 21 02 E9
00E0 | 49 16 D5 FA D8 3F A2 12 A7 7B 74 1B CC 2B C2 F1
00F0 | 82 52 33 73 C9 1A CF 85 D3 09 23 F2 FA FF 5C 08
0100 | 5E 93 30 6B 51 3C B7 F9 DF F9 85 2F 68 77 24 04
0110 | 6F DD F2 13 CB 28 6B 2E 9E 55 61 6D B4 81 AB 6A
0120 | C0 EF 75 81 F6 7B F1 80 38 FB 19 26 3E 5D 39 53
0130 | 67 D5 AE EB 30 C6 98 F0 EF 1E A0 BB 44 9B 08 CD
0140 | F4 33 99 8A FC 89 63 B3 BC 08 88 B9 B2 A4 18 C7
0150 | E3 25 E1 6A 9B 53 B8 B2 09 44 15 AA 1A EF FA 3E
0160 | 5E 6F 2B CA B1 A5 11 45 F5 FC B2 C7 A0 40 74 22
0170 | 4D C3 6B A5 A5 8D AB 01 DB 6D 32 4E 6B 69 14 DE
0180 | 69 40 B2 E8 A4 2E 77 BE EB 60 63 8B 7E D0 1C 61
0190 | 2E 4E 76 B9 7E 46 C1 60 F0 23 D6 B9 C0 19 D4 83
01A0 | 99 34 A4 44 A3 2C DC 2A 0D D8 9F EB D8 FD 4D C8
01B0 | BD 44 02 B6 09 F2 81 72 C5 0B 0E 8E A6 85 7C BA
01C0 | EA C7 5D C0 50 64 AD CE D0 F5 E1 F0 57 69 40 F9
01D0 | 01 06 A8 A6 4D 4B 34 EF EA 6B A2 61 44 F6 1B FE
01E0 | 27 00 78 64 8B 08 74 4D 00 87 A3 B0 F9 F9 FF F5
01F0 | 00 27 19 B7 79 3A 9B FA 7D E8 40 F4 30 49 99 09
0200 | 61 F4 86 A2 38 90 CB 0E 5D 9B 9E 2D DE 94 A9 5B
0210 | BE 13 A4 E3 4C D4 A1 90 0A FD E0 E2 90 A9 8A B2
0220 | D3 13 EC AB 03 A1 C0 6D 09 0B E6 62 65 37 2E 7B
0230 | C6 92 DB 91 25 AC 04 F6 58 05 D8 B6 03 60 A0 DB
0240 | E4 CD 5C B8 5A 91 1D AA 29 32 8A 49 03 B6 2F 6F
0250 | 89 8C 59 13 AF 01 75 6F 1C B8 08 C9 D1 71 22 69
0260 | 25 51 1B E9 D6 32 A5 C2 5E D6 7C EC 0D C3 4A 2A
0270 | 3E 45 A0 B8 7D 58 B6 9D 41 08 1F 02 B0 2A C3 20
0280 | 3E EA EA 6B D2 CF 36 F5 71 24 FD CE</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
<table class="table">
@ -464,13 +464,13 @@ random_padding_bytes = DF354798C82F052E630CE189EF0680BABDC2A6AC2F20E1A5A0C4574F9
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>016CBECF78533465</code></td>
<td><code>01008971F31E3865</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>D8020000</code> (728 in decimal)</td>
<td><code>C4020000</code> (708 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = DF354798C82F052E630CE189EF0680BABDC2A6AC2F20E1A5A0C4574F9
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>851D932F9AC467824C264C845780B10A</code></td>
<td><code>AF73D51E13D1A92559213C56961D02F8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE50020008C5C250B228D1BFCA8A0076</code> <code>56DBF013D4A1DDC67EC366988860907F</code> <code>C2FA0463817C1FF3B0B78EDFDA10331C</code> <code>7C12AF82BEDC3E97B44D0CD09C85F2CB</code> <code>CBD82BC5DAF01CF117F96732CC2899CB</code> <code>5373E6814B6C8203A06ADC0E46C95568</code> <code>D5841299A621F7276EC82F9C35684B02</code> <code>7EEF9ABA08EE3A4A06F8483A6B850960</code> <code>00D99AB9C46E3D2F9C185CCF580BDD0B</code> <code>4E920878BD8E24AAD5717C0A15C34039</code> <code>FACEDE3988611690424D44D5467B33A7</code> <code>3E5D9BEA4FBDBB0B0B167C781F7D5703</code> <code>B50401DFD5DA39815A50318D210E5C6A</code> <code>737CCD821A1F6F221227238EC7FEF685</code> <code>DFC583F695E08D78C1DE38C08EBF37AC</code> <code>A6CC54692534F905FC18428B79D2EE80</code> <code>44875CD34971A16A5CCCD7076FFB713D</code> <code>5780E17093C7469BDA0BE7DC53B375A8</code> <code>011BA72077F9AB2E970AF66E2704387D</code> <code>A57FEDB93DC0D143E92F6E0235B51629</code> <code>CEA32922038ACDAE32C794E80DCEF7C7</code> <code>8CB383C7DA14BA7BA7FED241BB4EF07F</code> <code>C0F7127AFB99332FEE37577E08E15400</code> <code>41EE5459E3CA66E40FCF41D8225BE932</code> <code>AEC8DF544D9759241B227315661C10A9</code> <code>951B3913A8CFB1BBC1829F30D7AC8F7E</code> <code>27E410D8B313EF8B48A99D4AE57B4CB8</code> <code>234DD87C6A653591955791E6F8810F10</code> <code>1F3496D3D5C0BF3EA24339B5336EB4F3</code> <code>4CEFC0D52AB3372165C2AB875198F9F3</code> <code>A6592AD09C78319AD798F25706AF91C6</code> <code>BFD43A1DB72CCF007C4A52DCB12EF84C</code> <code>1F64B212D9C4396490AC98500945A987</code> <code>8A246EAEAFE5EF525AB6F7CB24519326</code> <code>0AEC637724E95DB44E6461553423BB4C</code> <code>775928E22AF8B5EB91BF35BEFC133FA8</code> <code>33BCF9258335947F8919C0F02372D0A6</code><br> <code>0F32137B</code></td>
<td><code>FE500200EFEEF803D63527212D154C9D</code> <code>657B4AC42D0688AC04064DB1085B51F2</code> <code>F30AF6B4D1F9209DE819A5AD700F1C9F</code> <code>DD0B77CC40A0435CA539E52550531682</code> <code>000210B894DBD835CDD45FA318DF6867</code> <code>B3078A2499D2E0A77C6DEDD0F172E8D5</code> <code>349290946C8957125FD8B9FFE685901B</code> <code>2896275DF86ADF8A0BC40DEC764CE995</code> <code>9232A27A7A5D34EB0C31B6876A5E2E7B</code> <code>7F0C730265EEF0877AC1B732D67E579A</code> <code>CFA1E4F0272102E94916D5FAD83FA212</code> <code>A77B741BCC2BC2F182523373C91ACF85</code> <code>D30923F2FAFF5C085E93306B513CB7F9</code> <code>DFF9852F687724046FDDF213CB286B2E</code> <code>9E55616DB481AB6AC0EF7581F67BF180</code> <code>38FB19263E5D395367D5AEEB30C698F0</code> <code>EF1EA0BB449B08CDF433998AFC8963B3</code> <code>BC0888B9B2A418C7E325E16A9B53B8B2</code> <code>094415AA1AEFFA3E5E6F2BCAB1A51145</code> <code>F5FCB2C7A04074224DC36BA5A58DAB01</code> <code>DB6D324E6B6914DE6940B2E8A42E77BE</code> <code>EB60638B7ED01C612E4E76B97E46C160</code> <code>F023D6B9C019D4839934A444A32CDC2A</code> <code>0DD89FEBD8FD4DC8BD4402B609F28172</code> <code>C50B0E8EA6857CBAEAC75DC05064ADCE</code> <code>D0F5E1F0576940F90106A8A64D4B34EF</code> <code>EA6BA26144F61BFE270078648B08744D</code> <code>0087A3B0F9F9FFF5002719B7793A9BFA</code> <code>7DE840F43049990961F486A23890CB0E</code> <code>5D9B9E2DDE94A95BBE13A4E34CD4A190</code> <code>0AFDE0E290A98AB2D313ECAB03A1C06D</code> <code>090BE66265372E7BC692DB9125AC04F6</code> <code>5805D8B60360A0DBE4CD5CB85A911DAA</code> <code>29328A4903B62F6F898C5913AF01756F</code> <code>1CB808C9D171226925511BE9D632A5C2</code> <code>5ED67CEC0DC34A2A3E45A0B87D58B69D</code> <code>41081F02B02AC3203EEAEA6BD2CF36F5</code><br> <code>7124FDCE</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = DF354798C82F052E630CE189EF0680BABDC2A6AC2F20E1A5A0C4574F9
<!-- end server_DH_params_ok -->
<p>Decrypt <code>encrypted_answer</code> using the reverse of the process specified in <a href="/mtproto/auth_key#6-server-responds-with">step 6</a>:</p>
<!-- start server_DH_inner_data_input -->
<pre><code>encrypted_answer = 08C5C250B228D1BFCA8A007656DBF013D4A1DDC67EC366988860907FC2FA0463817C1FF3B0B78EDFDA10331C7C12AF82BEDC3E97B44D0CD09C85F2CBCBD82BC5DAF01CF117F96732CC2899CB5373E6814B6C8203A06ADC0E46C95568D5841299A621F7276EC82F9C35684B027EEF9ABA08EE3A4A06F8483A6B85096000D99AB9C46E3D2F9C185CCF580BDD0B4E920878BD8E24AAD5717C0A15C34039FACEDE3988611690424D44D5467B33A73E5D9BEA4FBDBB0B0B167C781F7D5703B50401DFD5DA39815A50318D210E5C6A737CCD821A1F6F221227238EC7FEF685DFC583F695E08D78C1DE38C08EBF37ACA6CC54692534F905FC18428B79D2EE8044875CD34971A16A5CCCD7076FFB713D5780E17093C7469BDA0BE7DC53B375A8011BA72077F9AB2E970AF66E2704387DA57FEDB93DC0D143E92F6E0235B51629CEA32922038ACDAE32C794E80DCEF7C78CB383C7DA14BA7BA7FED241BB4EF07FC0F7127AFB99332FEE37577E08E1540041EE5459E3CA66E40FCF41D8225BE932AEC8DF544D9759241B227315661C10A9951B3913A8CFB1BBC1829F30D7AC8F7E27E410D8B313EF8B48A99D4AE57B4CB8234DD87C6A653591955791E6F8810F101F3496D3D5C0BF3EA24339B5336EB4F34CEFC0D52AB3372165C2AB875198F9F3A6592AD09C78319AD798F25706AF91C6BFD43A1DB72CCF007C4A52DCB12EF84C1F64B212D9C4396490AC98500945A9878A246EAEAFE5EF525AB6F7CB245193260AEC637724E95DB44E6461553423BB4C775928E22AF8B5EB91BF35BEFC133FA833BCF9258335947F8919C0F02372D0A60F32137B
tmp_aes_key = 514A37A771B535766D6EA72A3D3BCDA953CD105DA551401D46F11A08CA60462F
tmp_aes_iv = 746B261500FCA8167866E329FF258FD826B7F612088658E99CB32766DC87368B</code></pre>
<pre><code>encrypted_answer = EFEEF803D63527212D154C9D657B4AC42D0688AC04064DB1085B51F2F30AF6B4D1F9209DE819A5AD700F1C9FDD0B77CC40A0435CA539E52550531682000210B894DBD835CDD45FA318DF6867B3078A2499D2E0A77C6DEDD0F172E8D5349290946C8957125FD8B9FFE685901B2896275DF86ADF8A0BC40DEC764CE9959232A27A7A5D34EB0C31B6876A5E2E7B7F0C730265EEF0877AC1B732D67E579ACFA1E4F0272102E94916D5FAD83FA212A77B741BCC2BC2F182523373C91ACF85D30923F2FAFF5C085E93306B513CB7F9DFF9852F687724046FDDF213CB286B2E9E55616DB481AB6AC0EF7581F67BF18038FB19263E5D395367D5AEEB30C698F0EF1EA0BB449B08CDF433998AFC8963B3BC0888B9B2A418C7E325E16A9B53B8B2094415AA1AEFFA3E5E6F2BCAB1A51145F5FCB2C7A04074224DC36BA5A58DAB01DB6D324E6B6914DE6940B2E8A42E77BEEB60638B7ED01C612E4E76B97E46C160F023D6B9C019D4839934A444A32CDC2A0DD89FEBD8FD4DC8BD4402B609F28172C50B0E8EA6857CBAEAC75DC05064ADCED0F5E1F0576940F90106A8A64D4B34EFEA6BA26144F61BFE270078648B08744D0087A3B0F9F9FFF5002719B7793A9BFA7DE840F43049990961F486A23890CB0E5D9B9E2DDE94A95BBE13A4E34CD4A1900AFDE0E290A98AB2D313ECAB03A1C06D090BE66265372E7BC692DB9125AC04F65805D8B60360A0DBE4CD5CB85A911DAA29328A4903B62F6F898C5913AF01756F1CB808C9D171226925511BE9D632A5C25ED67CEC0DC34A2A3E45A0B87D58B69D41081F02B02AC3203EEAEA6BD2CF36F57124FDCE
tmp_aes_key = 080DA9E05172968714AF9C8E91343901A142E5CB189A138DC1C3EE1C63F22B7C
tmp_aes_iv = 495338BB912C906CF13D1E6101F7D81735ABFAE146A2F19A7F2EC16A1293829C</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 1451932303204CCD61A0575DB68927616F23E31FBA0D89B57BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10A03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003EB4F02AF02A8D1EAEF62192688DD4B72E299DBD012ABFB64A25016A4A68FB6217AC726906EFEEE3340F1FE2F25C4E560A4028415A558BEC84C3E0D055FC4FA0F41C50BDB902DE14EB4B2907090202810C745AD0A98E1C37BA951C587ADA038E40129E009B585166CB0788745EA23CEE6805C2F0BB6856BFC480E6D8152B0B74783A8457A57A9D550A44B8B3FD546B957770086478417FB8BE85CC97A96B50EF1AA623E8421C937AB8BEB31BDFFF29C64788C4210EE9AD766225442C20F8935D596F8BE31EC84F96060A19136D2EAFC7E0366047460A2D93AF72ABF15C8ED40A6F78E8CE58902854558D000F9127A0D3EBDB7C80AC23A3BCF292AF9C4B2BCC37785334658CB5F2A29B83C9B1
answer = BA0D89B57BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10A03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003EB4F02AF02A8D1EAEF62192688DD4B72E299DBD012ABFB64A25016A4A68FB6217AC726906EFEEE3340F1FE2F25C4E560A4028415A558BEC84C3E0D055FC4FA0F41C50BDB902DE14EB4B2907090202810C745AD0A98E1C37BA951C587ADA038E40129E009B585166CB0788745EA23CEE6805C2F0BB6856BFC480E6D8152B0B74783A8457A57A9D550A44B8B3FD546B957770086478417FB8BE85CC97A96B50EF1AA623E8421C937AB8BEB31BDFFF29C64788C4210EE9AD766225442C20F8935D596F8BE31EC84F96060A19136D2EAFC7E0366047460A2D93AF72ABF15C8ED40A6F78E8CE58902854558D000F9127A0D3EBDB7C80AC23A3BCF292AF9C4B2BCC37785334658CB5F2A29B83C9B1</code></pre>
<pre><code>answer_with_hash = D8B49B780EE0EFEC0C7CE08F534621D6A03A2BCABA0D89B58079E16E867BC482F9B48E2488E954B3AF73D51E13D1A92559213C56961D02F803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100C5325311ADFFE69972D90622CCA1BEEFC865A493A8AB7ED9C59F9C46DE4455CEFF6369538B6EDB45A2B0463AC2B77FE7DC0B48E8F2C4DF7E7C0CD007A16BD2F44AECF5A1C18FDD65E266B304107843650DCF09B46E0979F23DDB43EBDFF590D0E28675C2BF13081B0E3EF9B09CBE1034B49DBA936ECA4E00C0CCF4F928EBCEE5579EE53ABA0752EC0A8ECEFD96847A32778D49E1DEBFFB4C29101E30AA235BF55D15B6D5198A2912B1810DAB2A97DBA3EF30CD9E6EE108F3B259149CAD84754B1AB7DC8311D9B61C9161A030931FFE046CEE5026E87ECBBA3EDB0763A193639233360E24A78B4076ED6829878414F6D48FCC9E7CAD7F44E257F02DBD9BBB32A6F31E386592A592AEF4E86100
answer = BA0D89B58079E16E867BC482F9B48E2488E954B3AF73D51E13D1A92559213C56961D02F803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100C5325311ADFFE69972D90622CCA1BEEFC865A493A8AB7ED9C59F9C46DE4455CEFF6369538B6EDB45A2B0463AC2B77FE7DC0B48E8F2C4DF7E7C0CD007A16BD2F44AECF5A1C18FDD65E266B304107843650DCF09B46E0979F23DDB43EBDFF590D0E28675C2BF13081B0E3EF9B09CBE1034B49DBA936ECA4E00C0CCF4F928EBCEE5579EE53ABA0752EC0A8ECEFD96847A32778D49E1DEBFFB4C29101E30AA235BF55D15B6D5198A2912B1810DAB2A97DBA3EF30CD9E6EE108F3B259149CAD84754B1AB7DC8311D9B61C9161A030931FFE046CEE5026E87ECBBA3EDB0763A193639233360E24A78B4076ED6829878414F6D48FCC9E7CAD7F44E257F02DBD9BBB32A6F31E386592A592AEF4E86100</code></pre>
<!-- end server_DH_inner_data_output -->
<!-- start server_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | BA 0D 89 B5 7B CB 07 77 D6 CA 0B 09 19 33 62 DB
0010 | 79 65 57 9A 85 1D 93 2F 9A C4 67 82 4C 26 4C 84
0020 | 57 80 B1 0A 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 80 79 E1 6E 86 7B C4 82 F9 B4 8E 24
0010 | 88 E9 54 B3 AF 73 D5 1E 13 D1 A9 25 59 21 3C 56
0020 | 96 1D 02 F8 03 00 00 00 FE 00 01 00 C7 1C AE B9
0030 | C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23
0040 | 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A
0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E
@ -532,23 +532,23 @@ answer = BA0D89B57BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10
0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6
0110 | 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0
0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00
0130 | 3E B4 F0 2A F0 2A 8D 1E AE F6 21 92 68 8D D4 B7
0140 | 2E 29 9D BD 01 2A BF B6 4A 25 01 6A 4A 68 FB 62
0150 | 17 AC 72 69 06 EF EE E3 34 0F 1F E2 F2 5C 4E 56
0160 | 0A 40 28 41 5A 55 8B EC 84 C3 E0 D0 55 FC 4F A0
0170 | F4 1C 50 BD B9 02 DE 14 EB 4B 29 07 09 02 02 81
0180 | 0C 74 5A D0 A9 8E 1C 37 BA 95 1C 58 7A DA 03 8E
0190 | 40 12 9E 00 9B 58 51 66 CB 07 88 74 5E A2 3C EE
01A0 | 68 05 C2 F0 BB 68 56 BF C4 80 E6 D8 15 2B 0B 74
01B0 | 78 3A 84 57 A5 7A 9D 55 0A 44 B8 B3 FD 54 6B 95
01C0 | 77 70 08 64 78 41 7F B8 BE 85 CC 97 A9 6B 50 EF
01D0 | 1A A6 23 E8 42 1C 93 7A B8 BE B3 1B DF FF 29 C6
01E0 | 47 88 C4 21 0E E9 AD 76 62 25 44 2C 20 F8 93 5D
01F0 | 59 6F 8B E3 1E C8 4F 96 06 0A 19 13 6D 2E AF C7
0200 | E0 36 60 47 46 0A 2D 93 AF 72 AB F1 5C 8E D4 0A
0210 | 6F 78 E8 CE 58 90 28 54 55 8D 00 0F 91 27 A0 D3
0220 | EB DB 7C 80 AC 23 A3 BC F2 92 AF 9C 4B 2B CC 37
0230 | 78 53 34 65</code></pre>
0130 | C5 32 53 11 AD FF E6 99 72 D9 06 22 CC A1 BE EF
0140 | C8 65 A4 93 A8 AB 7E D9 C5 9F 9C 46 DE 44 55 CE
0150 | FF 63 69 53 8B 6E DB 45 A2 B0 46 3A C2 B7 7F E7
0160 | DC 0B 48 E8 F2 C4 DF 7E 7C 0C D0 07 A1 6B D2 F4
0170 | 4A EC F5 A1 C1 8F DD 65 E2 66 B3 04 10 78 43 65
0180 | 0D CF 09 B4 6E 09 79 F2 3D DB 43 EB DF F5 90 D0
0190 | E2 86 75 C2 BF 13 08 1B 0E 3E F9 B0 9C BE 10 34
01A0 | B4 9D BA 93 6E CA 4E 00 C0 CC F4 F9 28 EB CE E5
01B0 | 57 9E E5 3A BA 07 52 EC 0A 8E CE FD 96 84 7A 32
01C0 | 77 8D 49 E1 DE BF FB 4C 29 10 1E 30 AA 23 5B F5
01D0 | 5D 15 B6 D5 19 8A 29 12 B1 81 0D AB 2A 97 DB A3
01E0 | EF 30 CD 9E 6E E1 08 F3 B2 59 14 9C AD 84 75 4B
01F0 | 1A B7 DC 83 11 D9 B6 1C 91 61 A0 30 93 1F FE 04
0200 | 6C EE 50 26 E8 7E CB BA 3E DB 07 63 A1 93 63 92
0210 | 33 36 0E 24 A7 8B 40 76 ED 68 29 87 84 14 F6 D4
0220 | 8F CC 9E 7C AD 7F 44 E2 57 F0 2D BD 9B BB 32 A6
0230 | F3 1E 38 65</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
<table class="table">
@ -570,13 +570,13 @@ answer = BA0D89B57BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>851D932F9AC467824C264C845780B10A</code></td>
<td><code>AF73D51E13D1A92559213C56961D02F8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B57BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE0001003EB4F02AF02A8D1EAEF62192</code> <code>688DD4B72E299DBD012ABFB64A25016A</code> <code>4A68FB6217AC726906EFEEE3340F1FE2</code> <code>F25C4E560A4028415A558BEC84C3E0D0</code> <code>55FC4FA0F41C50BDB902DE14EB4B2907</code> <code>090202810C745AD0A98E1C37BA951C58</code> <code>7ADA038E40129E009B585166CB078874</code> <code>5EA23CEE6805C2F0BB6856BFC480E6D8</code> <code>152B0B74783A8457A57A9D550A44B8B3</code> <code>FD546B957770086478417FB8BE85CC97</code> <code>A96B50EF1AA623E8421C937AB8BEB31B</code> <code>DFFF29C64788C4210EE9AD766225442C</code> <code>20F8935D596F8BE31EC84F96060A1913</code> <code>6D2EAFC7E0366047460A2D93AF72ABF1</code> <code>5C8ED40A6F78E8CE58902854558D000F</code> <code>9127A0D3EBDB7C80AC23A3BCF292AF9C</code><br> <code>4B2BCC37</code></td>
<td><code>FE000100C5325311ADFFE69972D90622</code> <code>CCA1BEEFC865A493A8AB7ED9C59F9C46</code> <code>DE4455CEFF6369538B6EDB45A2B0463A</code> <code>C2B77FE7DC0B48E8F2C4DF7E7C0CD007</code> <code>A16BD2F44AECF5A1C18FDD65E266B304</code> <code>107843650DCF09B46E0979F23DDB43EB</code> <code>DFF590D0E28675C2BF13081B0E3EF9B0</code> <code>9CBE1034B49DBA936ECA4E00C0CCF4F9</code> <code>28EBCEE5579EE53ABA0752EC0A8ECEFD</code> <code>96847A32778D49E1DEBFFB4C29101E30</code> <code>AA235BF55D15B6D5198A2912B1810DAB</code> <code>2A97DBA3EF30CD9E6EE108F3B259149C</code> <code>AD84754B1AB7DC8311D9B61C9161A030</code> <code>931FFE046CEE5026E87ECBBA3EDB0763</code> <code>A193639233360E24A78B4076ED682987</code> <code>8414F6D48FCC9E7CAD7F44E257F02DBD</code><br> <code>9BBB32A6</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>78533465</code> (1697928056 in decimal)</td>
<td><code>F31E3865</code> (1698176755 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B57BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10
<h5><a class="anchor" href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" id="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" name="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message"><i class="anchor-icon"></i></a>7) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</h5>
<p>First, generate a secure random 2048-bit number b:</p>
<!-- start b -->
<pre><code>b = 512CFAF9303BDE146DBE83EB799749FFF3732D23C1AB55EF5B7316C263C86E44631B3EB3C2B762F94BCFE22BDCB7437D85D03896C66ED30E0336304987AA64C200A287862A21BA2A33725BF36A4A78ADEF0F24F3E610545D268CD7A75CC7782709FCA2B481CDF936BC2F5FE438722E19658E664807100313CEC843A3F5831E562555FB9553E0FF92F885CE6B859C143E3B913CD0E43E33AB59D611528740849B9834EA1FABF51F5D8238457C231947C382040B78379409599AA7502DEC78AD794F3DD2D0C4BC54328829DE50B5CCF5808ADAE4B88C70589D087847519C7BC71D2E181CD2CFC655A83DF7B59BF44D31BAA476723586639315221A756322898688</code></pre>
<pre><code>b = 6D2A58D0BEE6590111486859CD31894613AB8D54F482D3F6F00B0BB2EF5477D2BAA0C95923DE65F3A377225E21E928D51CE6E172767DA9A61EC7DF5BE8232697D9760F120373E4D7662BACA15172E886872730827946B2BCC4548BC28C788273DF8047B43BB71DBA454C68C5E3764F72B702234ACAD127E09F8E120A928664D5AE424E42B045D48D21600947E2CE1B57CA224D6F3A96435705E777984AFBB3CAC8E1E25D4177769053C6C23E62C231B662789373480B8F77CF60849F21ADE9722850927587B08B664222F652C14F78BE126F24CC22B11792FC2D43E7E6E6285D0AF857A221EBD8C6111773B0A0B6DBC6D34BB7B53D0BD8E685874A108A1F3BFB</code></pre>
<!-- end b -->
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
<!-- start g_b -->
<pre><code>g_b = 74B6AA22985013C7AE23B8FE0492B003B558BD2132C74EB0113EAA6023D9711DAFAF24B7AB0D2E76B7C8D029B99BC85249E5E15E7012F7331883365FCF8964DBA6E73854AB3526D179065015D9C972AE7808D624AFD64E844287A87B2D4A5069000133E950F899C1E48CFD24A071FAEF13E5B34D3308F276F1C2C90D3084D24CD37071A6A25C5E2052E92422C2D51A8EBCB3EBF3D3E2073A833FA7CEE56D8ABF7D1F24CCFECA76DC3826C09D35469F564039855772EBFE3B47666101537870A90174211B2F2A255B85523FB166C40AA1111A55B2240C40EF5B68AEE4CF85764213025CF88A3A7C365E1480DFA25B34ABC706DAFEA8A5CC27FEAD44CCF1FEBFA4</code></pre>
<pre><code>g_b = 0626BC9CE2117393C48CB279242C068CCDF636D364F38A119E9D551778F62B4E04807A3F604D69464E49B30F60479BB952376D72276D6E87408CA34745A0C35E7E4E505DCA1EEB233C4D4FB00CDC1B1B7414CB50A6A017F3E8F038814CECE50676FBB9CA533E8A23FD69A3AB17DDFD9BE10713214CF6DEE327B005A358697D4D56C3529EDB238C280A6C2D75314E9B49CDAC0FB1D2D22B7BCF6302AE315BE029477F4E01F28E07F825DEB486522788FB0ECFE3D852FFFD4092336E68EBDE6F9908F32694EDD4537384DB149BFAB09321B27362F9DB405D8427584BC02B36F5B735EBE90C8FACB837971C166DF683EB8FD0BC38E96F09504B8161215494B29605</code></pre>
<!-- end g_b -->
<h6>7.1) generation of encrypted_data</h6>
<!-- start client_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 54 B6 43 66 7B CB 07 77 D6 CA 0B 09 19 33 62 DB
0010 | 79 65 57 9A 85 1D 93 2F 9A C4 67 82 4C 26 4C 84
0020 | 57 80 B1 0A 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 74 B6 AA 22 98 50 13 C7 AE 23 B8 FE 04 92 B0 03
0040 | B5 58 BD 21 32 C7 4E B0 11 3E AA 60 23 D9 71 1D
0050 | AF AF 24 B7 AB 0D 2E 76 B7 C8 D0 29 B9 9B C8 52
0060 | 49 E5 E1 5E 70 12 F7 33 18 83 36 5F CF 89 64 DB
0070 | A6 E7 38 54 AB 35 26 D1 79 06 50 15 D9 C9 72 AE
0080 | 78 08 D6 24 AF D6 4E 84 42 87 A8 7B 2D 4A 50 69
0090 | 00 01 33 E9 50 F8 99 C1 E4 8C FD 24 A0 71 FA EF
00A0 | 13 E5 B3 4D 33 08 F2 76 F1 C2 C9 0D 30 84 D2 4C
00B0 | D3 70 71 A6 A2 5C 5E 20 52 E9 24 22 C2 D5 1A 8E
00C0 | BC B3 EB F3 D3 E2 07 3A 83 3F A7 CE E5 6D 8A BF
00D0 | 7D 1F 24 CC FE CA 76 DC 38 26 C0 9D 35 46 9F 56
00E0 | 40 39 85 57 72 EB FE 3B 47 66 61 01 53 78 70 A9
00F0 | 01 74 21 1B 2F 2A 25 5B 85 52 3F B1 66 C4 0A A1
0100 | 11 1A 55 B2 24 0C 40 EF 5B 68 AE E4 CF 85 76 42
0110 | 13 02 5C F8 8A 3A 7C 36 5E 14 80 DF A2 5B 34 AB
0120 | C7 06 DA FE A8 A5 CC 27 FE AD 44 CC F1 FE BF A4</code></pre>
<pre><code>0000 | 54 B6 43 66 80 79 E1 6E 86 7B C4 82 F9 B4 8E 24
0010 | 88 E9 54 B3 AF 73 D5 1E 13 D1 A9 25 59 21 3C 56
0020 | 96 1D 02 F8 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 06 26 BC 9C E2 11 73 93 C4 8C B2 79 24 2C 06 8C
0040 | CD F6 36 D3 64 F3 8A 11 9E 9D 55 17 78 F6 2B 4E
0050 | 04 80 7A 3F 60 4D 69 46 4E 49 B3 0F 60 47 9B B9
0060 | 52 37 6D 72 27 6D 6E 87 40 8C A3 47 45 A0 C3 5E
0070 | 7E 4E 50 5D CA 1E EB 23 3C 4D 4F B0 0C DC 1B 1B
0080 | 74 14 CB 50 A6 A0 17 F3 E8 F0 38 81 4C EC E5 06
0090 | 76 FB B9 CA 53 3E 8A 23 FD 69 A3 AB 17 DD FD 9B
00A0 | E1 07 13 21 4C F6 DE E3 27 B0 05 A3 58 69 7D 4D
00B0 | 56 C3 52 9E DB 23 8C 28 0A 6C 2D 75 31 4E 9B 49
00C0 | CD AC 0F B1 D2 D2 2B 7B CF 63 02 AE 31 5B E0 29
00D0 | 47 7F 4E 01 F2 8E 07 F8 25 DE B4 86 52 27 88 FB
00E0 | 0E CF E3 D8 52 FF FD 40 92 33 6E 68 EB DE 6F 99
00F0 | 08 F3 26 94 ED D4 53 73 84 DB 14 9B FA B0 93 21
0100 | B2 73 62 F9 DB 40 5D 84 27 58 4B C0 2B 36 F5 B7
0110 | 35 EB E9 0C 8F AC B8 37 97 1C 16 6D F6 83 EB 8F
0120 | D0 BC 38 E9 6F 09 50 4B 81 61 21 54 94 B2 96 05</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;</code></pre>
<table class="table">
@ -658,19 +658,19 @@ answer = BA0D89B57BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>851D932F9AC467824C264C845780B10A</code></td>
<td><code>AF73D51E13D1A92559213C56961D02F8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE00010074B6AA22985013C7AE23B8FE</code> <code>0492B003B558BD2132C74EB0113EAA60</code> <code>23D9711DAFAF24B7AB0D2E76B7C8D029</code> <code>B99BC85249E5E15E7012F7331883365F</code> <code>CF8964DBA6E73854AB3526D179065015</code> <code>D9C972AE7808D624AFD64E844287A87B</code> <code>2D4A5069000133E950F899C1E48CFD24</code> <code>A071FAEF13E5B34D3308F276F1C2C90D</code> <code>3084D24CD37071A6A25C5E2052E92422</code> <code>C2D51A8EBCB3EBF3D3E2073A833FA7CE</code> <code>E56D8ABF7D1F24CCFECA76DC3826C09D</code> <code>35469F564039855772EBFE3B47666101</code> <code>537870A90174211B2F2A255B85523FB1</code> <code>66C40AA1111A55B2240C40EF5B68AEE4</code> <code>CF85764213025CF88A3A7C365E1480DF</code> <code>A25B34ABC706DAFEA8A5CC27FEAD44CC</code><br> <code>F1FEBFA4</code></td>
<td><code>FE0001000626BC9CE2117393C48CB279</code> <code>242C068CCDF636D364F38A119E9D5517</code> <code>78F62B4E04807A3F604D69464E49B30F</code> <code>60479BB952376D72276D6E87408CA347</code> <code>45A0C35E7E4E505DCA1EEB233C4D4FB0</code> <code>0CDC1B1B7414CB50A6A017F3E8F03881</code> <code>4CECE50676FBB9CA533E8A23FD69A3AB</code> <code>17DDFD9BE10713214CF6DEE327B005A3</code> <code>58697D4D56C3529EDB238C280A6C2D75</code> <code>314E9B49CDAC0FB1D2D22B7BCF6302AE</code> <code>315BE029477F4E01F28E07F825DEB486</code> <code>522788FB0ECFE3D852FFFD4092336E68</code> <code>EBDE6F9908F32694EDD4537384DB149B</code> <code>FAB09321B27362F9DB405D8427584BC0</code> <code>2B36F5B735EBE90C8FACB837971C166D</code> <code>F683EB8FD0BC38E96F09504B81612154</code><br> <code>94B29605</code></td>
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
</tr>
<tr>
@ -684,47 +684,47 @@ answer = BA0D89B57BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10
<!-- end client_DH_inner_data -->
<p>The serialization of <em>Client_DH_Inner_Data</em> produces a string <strong>data</strong>. This is used to generate <strong>encrypted_data</strong> as specified in <a href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message">step 6</a>, using the following inputs:</p>
<!-- start client_DH_inner_data_input -->
<pre><code>data = 54B643667BCB0777D6CA0B09193362DB7965579A851D932F9AC467824C264C845780B10A0000000000000000FE00010074B6AA22985013C7AE23B8FE0492B003B558BD2132C74EB0113EAA6023D9711DAFAF24B7AB0D2E76B7C8D029B99BC85249E5E15E7012F7331883365FCF8964DBA6E73854AB3526D179065015D9C972AE7808D624AFD64E844287A87B2D4A5069000133E950F899C1E48CFD24A071FAEF13E5B34D3308F276F1C2C90D3084D24CD37071A6A25C5E2052E92422C2D51A8EBCB3EBF3D3E2073A833FA7CEE56D8ABF7D1F24CCFECA76DC3826C09D35469F564039855772EBFE3B47666101537870A90174211B2F2A255B85523FB166C40AA1111A55B2240C40EF5B68AEE4CF85764213025CF88A3A7C365E1480DFA25B34ABC706DAFEA8A5CC27FEAD44CCF1FEBFA4
padding = BE63F7932F302E8BAEAA620F
tmp_aes_key = 514A37A771B535766D6EA72A3D3BCDA953CD105DA551401D46F11A08CA60462F
tmp_aes_iv = 746B261500FCA8167866E329FF258FD826B7F612088658E99CB32766DC87368B</code></pre>
<pre><code>data = 54B643668079E16E867BC482F9B48E2488E954B3AF73D51E13D1A92559213C56961D02F80000000000000000FE0001000626BC9CE2117393C48CB279242C068CCDF636D364F38A119E9D551778F62B4E04807A3F604D69464E49B30F60479BB952376D72276D6E87408CA34745A0C35E7E4E505DCA1EEB233C4D4FB00CDC1B1B7414CB50A6A017F3E8F038814CECE50676FBB9CA533E8A23FD69A3AB17DDFD9BE10713214CF6DEE327B005A358697D4D56C3529EDB238C280A6C2D75314E9B49CDAC0FB1D2D22B7BCF6302AE315BE029477F4E01F28E07F825DEB486522788FB0ECFE3D852FFFD4092336E68EBDE6F9908F32694EDD4537384DB149BFAB09321B27362F9DB405D8427584BC02B36F5B735EBE90C8FACB837971C166DF683EB8FD0BC38E96F09504B8161215494B29605
padding = 7857EE13181263277AE0ADF9
tmp_aes_key = 080DA9E05172968714AF9C8E91343901A142E5CB189A138DC1C3EE1C63F22B7C
tmp_aes_iv = 495338BB912C906CF13D1E6101F7D81735ABFAE146A2F19A7F2EC16A1293829C</code></pre>
<!-- end client_DH_inner_data_input -->
<p>Process:</p>
<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16)
encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre>
<p>Output:</p>
<!-- start client_DH_inner_data_output -->
<pre><code>encrypted_data = 06A7C90FDE824B238DF7A1DF406D1AFE3F48966A7E25787AC20AB043469D6216168BF3313B34C853A12638461C2B8D03E1CCB9431242C6F9F8C727E076F7C5F149F00FCBC9A60A592AAF0B0FA0ABC32D7D9BD91735E3E0CDBFB48471D15E8D6677994175830F83B1BD31767CFA8BD4261D05774DCD2BDACD35E661815E3D0C1E43F529BA295D230B532D3C223659C2E428BEEE1110EA4FC7CAB758103B11781A2352224CB427839B69449112C4A232140956E0594B872F95CA70CF19FB210521892D74A3EA55B3AC522FDB5E8567AE77C521E60FD8B75F73A673677ADCB7E684A137F040590B7E963A98A4D9B2123235E4236D7A812CDF2A490A7C4BB60ECF98E99A2C9D092759A6CAC6D516808D596E32936701FFAA471E24EE8A60C358F6D68A64D465219D40A2402887B54FF683E6466262D8E43FAD02B1858D36BB9CC947F5950F13D30BB07CD2F708E68D148AFF</code></pre>
<pre><code>encrypted_data = 5CD0C82F80942D51715459C037E1458D7C1462F593E011D2AE4760446F37478B954E7096043F465A728D909ED915705D0AFF9A065D41934A3339B39DCC227495593B50AE231623D42ADAF20CA895BECEBF500B840B4B04D68EDA601BFFF53F9B9991B8C355CAA67A4E8C5ED8E4531C7143554CF380C447FB38C5951597186CE04B32779048B0417E5F12757AFF123FD4817999312A7875CC4F6E566B286FE131A41AF4725757762994184796855C9A296BAA2B6364E73037BEE0637C0FD8345EFBD1F572E0B90D130065F8F6CA449D3D0ED1C759C930C803559E4A42C33BA1D046A406AB5E5A8C9A5D5066854AE4B635621C21F84F4CB55D304EC8F3665ADB59FA5A614F03E33835972567009D1CC32A6232E8551B9966E0BDEDF34AC74FE62372E9ABA32FCC5CE234315379598509721BE36A522B3C55DBAE92DD0FEA088E2356FC14960D4A0EDAAFAAFFA70CAE707C</code></pre>
<!-- end client_DH_inner_data_output -->
<p>The length of the final string is 336 bytes.</p>
<h6>7.2) set_client_DH_params query</h6>
<!-- start set_client_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 88 D3 08 00 7A 53 34 65
0010 | 78 01 00 00 1F 5F 04 F5 7B CB 07 77 D6 CA 0B 09
0020 | 19 33 62 DB 79 65 57 9A 85 1D 93 2F 9A C4 67 82
0030 | 4C 26 4C 84 57 80 B1 0A FE 50 01 00 06 A7 C9 0F
0040 | DE 82 4B 23 8D F7 A1 DF 40 6D 1A FE 3F 48 96 6A
0050 | 7E 25 78 7A C2 0A B0 43 46 9D 62 16 16 8B F3 31
0060 | 3B 34 C8 53 A1 26 38 46 1C 2B 8D 03 E1 CC B9 43
0070 | 12 42 C6 F9 F8 C7 27 E0 76 F7 C5 F1 49 F0 0F CB
0080 | C9 A6 0A 59 2A AF 0B 0F A0 AB C3 2D 7D 9B D9 17
0090 | 35 E3 E0 CD BF B4 84 71 D1 5E 8D 66 77 99 41 75
00A0 | 83 0F 83 B1 BD 31 76 7C FA 8B D4 26 1D 05 77 4D
00B0 | CD 2B DA CD 35 E6 61 81 5E 3D 0C 1E 43 F5 29 BA
00C0 | 29 5D 23 0B 53 2D 3C 22 36 59 C2 E4 28 BE EE 11
00D0 | 10 EA 4F C7 CA B7 58 10 3B 11 78 1A 23 52 22 4C
00E0 | B4 27 83 9B 69 44 91 12 C4 A2 32 14 09 56 E0 59
00F0 | 4B 87 2F 95 CA 70 CF 19 FB 21 05 21 89 2D 74 A3
0100 | EA 55 B3 AC 52 2F DB 5E 85 67 AE 77 C5 21 E6 0F
0110 | D8 B7 5F 73 A6 73 67 7A DC B7 E6 84 A1 37 F0 40
0120 | 59 0B 7E 96 3A 98 A4 D9 B2 12 32 35 E4 23 6D 7A
0130 | 81 2C DF 2A 49 0A 7C 4B B6 0E CF 98 E9 9A 2C 9D
0140 | 09 27 59 A6 CA C6 D5 16 80 8D 59 6E 32 93 67 01
0150 | FF AA 47 1E 24 EE 8A 60 C3 58 F6 D6 8A 64 D4 65
0160 | 21 9D 40 A2 40 28 87 B5 4F F6 83 E6 46 62 62 D8
0170 | E4 3F AD 02 B1 85 8D 36 BB 9C C9 47 F5 95 0F 13
0180 | D3 0B B0 7C D2 F7 08 E6 8D 14 8A FF</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D4 CE 0A 00 F7 1E 38 65
0010 | 78 01 00 00 1F 5F 04 F5 80 79 E1 6E 86 7B C4 82
0020 | F9 B4 8E 24 88 E9 54 B3 AF 73 D5 1E 13 D1 A9 25
0030 | 59 21 3C 56 96 1D 02 F8 FE 50 01 00 5C D0 C8 2F
0040 | 80 94 2D 51 71 54 59 C0 37 E1 45 8D 7C 14 62 F5
0050 | 93 E0 11 D2 AE 47 60 44 6F 37 47 8B 95 4E 70 96
0060 | 04 3F 46 5A 72 8D 90 9E D9 15 70 5D 0A FF 9A 06
0070 | 5D 41 93 4A 33 39 B3 9D CC 22 74 95 59 3B 50 AE
0080 | 23 16 23 D4 2A DA F2 0C A8 95 BE CE BF 50 0B 84
0090 | 0B 4B 04 D6 8E DA 60 1B FF F5 3F 9B 99 91 B8 C3
00A0 | 55 CA A6 7A 4E 8C 5E D8 E4 53 1C 71 43 55 4C F3
00B0 | 80 C4 47 FB 38 C5 95 15 97 18 6C E0 4B 32 77 90
00C0 | 48 B0 41 7E 5F 12 75 7A FF 12 3F D4 81 79 99 31
00D0 | 2A 78 75 CC 4F 6E 56 6B 28 6F E1 31 A4 1A F4 72
00E0 | 57 57 76 29 94 18 47 96 85 5C 9A 29 6B AA 2B 63
00F0 | 64 E7 30 37 BE E0 63 7C 0F D8 34 5E FB D1 F5 72
0100 | E0 B9 0D 13 00 65 F8 F6 CA 44 9D 3D 0E D1 C7 59
0110 | C9 30 C8 03 55 9E 4A 42 C3 3B A1 D0 46 A4 06 AB
0120 | 5E 5A 8C 9A 5D 50 66 85 4A E4 B6 35 62 1C 21 F8
0130 | 4F 4C B5 5D 30 4E C8 F3 66 5A DB 59 FA 5A 61 4F
0140 | 03 E3 38 35 97 25 67 00 9D 1C C3 2A 62 32 E8 55
0150 | 1B 99 66 E0 BD ED F3 4A C7 4F E6 23 72 E9 AB A3
0160 | 2F CC 5C E2 34 31 53 79 59 85 09 72 1B E3 6A 52
0170 | 2B 3C 55 DB AE 92 DD 0F EA 08 8E 23 56 FC 14 96
0180 | 0D 4A 0E DA AF AA FF A7 0C AE 70 7C</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>88D308007A533465</code></td>
<td><code>D4CE0A00F71E3865</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>851D932F9AC467824C264C845780B10A</code></td>
<td><code>AF73D51E13D1A92559213C56961D02F8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE50010006A7C90FDE824B238DF7A1DF</code> <code>406D1AFE3F48966A7E25787AC20AB043</code> <code>469D6216168BF3313B34C853A1263846</code> <code>1C2B8D03E1CCB9431242C6F9F8C727E0</code> <code>76F7C5F149F00FCBC9A60A592AAF0B0F</code> <code>A0ABC32D7D9BD91735E3E0CDBFB48471</code> <code>D15E8D6677994175830F83B1BD31767C</code> <code>FA8BD4261D05774DCD2BDACD35E66181</code> <code>5E3D0C1E43F529BA295D230B532D3C22</code> <code>3659C2E428BEEE1110EA4FC7CAB75810</code> <code>3B11781A2352224CB427839B69449112</code> <code>C4A232140956E0594B872F95CA70CF19</code> <code>FB210521892D74A3EA55B3AC522FDB5E</code> <code>8567AE77C521E60FD8B75F73A673677A</code> <code>DCB7E684A137F040590B7E963A98A4D9</code> <code>B2123235E4236D7A812CDF2A490A7C4B</code> <code>B60ECF98E99A2C9D092759A6CAC6D516</code> <code>808D596E32936701FFAA471E24EE8A60</code> <code>C358F6D68A64D465219D40A2402887B5</code> <code>4FF683E6466262D8E43FAD02B1858D36</code> <code>BB9CC947F5950F13D30BB07CD2F708E6</code><br> <code>8D148AFF</code></td>
<td><code>FE5001005CD0C82F80942D51715459C0</code> <code>37E1458D7C1462F593E011D2AE476044</code> <code>6F37478B954E7096043F465A728D909E</code> <code>D915705D0AFF9A065D41934A3339B39D</code> <code>CC227495593B50AE231623D42ADAF20C</code> <code>A895BECEBF500B840B4B04D68EDA601B</code> <code>FFF53F9B9991B8C355CAA67A4E8C5ED8</code> <code>E4531C7143554CF380C447FB38C59515</code> <code>97186CE04B32779048B0417E5F12757A</code> <code>FF123FD4817999312A7875CC4F6E566B</code> <code>286FE131A41AF4725757762994184796</code> <code>855C9A296BAA2B6364E73037BEE0637C</code> <code>0FD8345EFBD1F572E0B90D130065F8F6</code> <code>CA449D3D0ED1C759C930C803559E4A42</code> <code>C33BA1D046A406AB5E5A8C9A5D506685</code> <code>4AE4B635621C21F84F4CB55D304EC8F3</code> <code>665ADB59FA5A614F03E3383597256700</code> <code>9D1CC32A6232E8551B9966E0BDEDF34A</code> <code>C74FE62372E9ABA32FCC5CE234315379</code> <code>598509721BE36A522B3C55DBAE92DD0F</code> <code>EA088E2356FC14960D4A0EDAAFAAFFA7</code><br> <code>0CAE707C</code></td>
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
</tr>
</tbody>
@ -785,17 +785,17 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<h5><a class="anchor" href="#8-auth-key-generation" id="8-auth-key-generation" name="8-auth-key-generation"><i class="anchor-icon"></i></a>8) Auth key generation</h5>
<p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p>
<!-- start auth_key -->
<pre><code>auth_key = 60DA731A871E31C482F8391E4D1A31320E95978A1F6114B0A09B71A895CE70A0081DA513736D2B402A7742FC4B805DFCFB7069A60A1EEF2E6A3BEFB755DFF4D72DACF16246082B7D32017F070420DDF89587ABBA48AA3E9978FB365478C3B017E440D644914BC4DF5A64B13C6C06B8BF9E742F4D2E7214E3F3380E2670118A65BD9CF8EA7FB1EB8BA489BCE24A1CF5F4244D031D5F01D77F85AD20928690320218D0E7F1A27938C36571D6BD4FC201AD6546405941C40B1B0E41F7252FA400C80CD17FA2423C0CF3CC7BC48F795E83D581AEE04EEDC7925D319FBC9CB8183345B6E0DF0D3F0ACDDC0AD3BFBFBC3E5ABEF181D05DC79C0381937B9C8EC0390A9C</code></pre>
<pre><code>auth_key = 4A8A768A6D38ECD7877A8A5913BABE5F905CEFC4D2B3D280A5878F88A3CE7FA6C38EA436FD2E032B2942B335F4FC58334A7C24D5D76B6DC3A55A46DBA36A26E96F48C078438D1080223EBA143BA47645EF0D62A2F783667EBC2CAC8A0D7D99B65B76D2B174419C39C191F8C112ECA797D45C1FC2F1EF82B97270FCECDA7A940F30049D0E132AEF507FC9003A625CB7037D9EB569A78DFAEB2A9ED5DC3705D0638374587AAF4B566457B0C4BBF2B3B50F6ABBA76B0D13C44C5DD90A29146A98A9D9F260B737403F10381E832DE220DBE37F52A841EE2A3E5B96DF679601CC0681D809BBC1A755C4E0D7663D6315A83E5EC3F6888C008AD60E84C3C99AC25ED7CA</code></pre>
<!-- end auth_key -->
<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5>
<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p>
<!-- start dh_gen_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 B4 D3 17 79 53 34 65
0010 | 54 00 00 00 34 F7 CB 3B 7B CB 07 77 D6 CA 0B 09
0020 | 19 33 62 DB 79 65 57 9A 85 1D 93 2F 9A C4 67 82
0030 | 4C 26 4C 84 57 80 B1 0A 4B E7 34 28 C8 17 FF 45
0040 | 24 65 D2 67 EF 2A 37 40</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 9C 88 C4 F3 1E 38 65
0010 | 68 00 00 00 34 F7 CB 3B 80 79 E1 6E 86 7B C4 82
0020 | F9 B4 8E 24 88 E9 54 B3 AF 73 D5 1E 13 D1 A9 25
0030 | 59 21 3C 56 96 1D 02 F8 BF 8E 6C 87 59 5D 8B 4F
0040 | B7 CB 2E 57 94 1D 91 CE</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01B4D31779533465</code></td>
<td><code>019C88C4F31E3865</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>54000000</code> (84 in decimal)</td>
<td><code>68000000</code> (104 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>7BCB0777D6CA0B09193362DB7965579A</code></td>
<td><code>8079E16E867BC482F9B48E2488E954B3</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>851D932F9AC467824C264C845780B10A</code></td>
<td><code>AF73D51E13D1A92559213C56961D02F8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>4BE73428C817FF452465D267EF2A3740</code></td>
<td><code>BF8E6C87595D8B4FB7CB2E57941D91CE</code></td>
<td>The 128 lower-order bits of SHA1 of the byte string derived from the <code>new_nonce</code> string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with <code>auth_key_aux_hash</code>. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</td>
</tr>
</tbody>

View file

@ -503,7 +503,7 @@
</tr>
<tr>
<td><a href="/constructor/updatePeerBlocked">updatePeerBlocked</a></td>
<td>A peer was blocked</td>
<td>We blocked a peer, see <a href="/api/block">here »</a> for more info on blocklists.</td>
</tr>
<tr>
<td><a href="/constructor/updateChannelUserTyping">updateChannelUserTyping</a></td>