Sophie

Sophie

distrib > Mageia > 6 > x86_64 > by-pkgid > f835bee5b8b7ec08e20fae17cab51e63 > files > 628

lib64mbedtls-devel-2.7.3-1.mga6.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>mbed TLS v2.7.3: timing.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">mbed TLS v2.7.3
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_b4d146e9a6d8dd56ed4afb2480a97fd3.html">mbedtls</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">timing.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Portable interface to timeouts and to the CPU cycle counter.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="config_8h_source.html">config.h</a>&quot;</code><br />
<code>#include &lt;stdint.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for timing.h:</div>
<div class="dyncontent">
<div class="center"><img src="timing_8h__incl.png" border="0" usemap="#timing_8h" alt=""/></div>
<map name="timing_8h" id="timing_8h">
</map>
</div>
</div>
<p><a href="timing_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmbedtls__timing__hr__time.html">mbedtls_timing_hr_time</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">timer structure  <a href="structmbedtls__timing__hr__time.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmbedtls__timing__delay__context.html">mbedtls_timing_delay_context</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Context for mbedtls_timing_set/get_delay()  <a href="structmbedtls__timing__delay__context.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aeec9ae2577ce34ab01f2d213b99d07e1"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timing_8h.html#aeec9ae2577ce34ab01f2d213b99d07e1">mbedtls_timing_hardclock</a> (void)</td></tr>
<tr class="memdesc:aeec9ae2577ce34ab01f2d213b99d07e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the CPU cycle counter value.  <a href="#aeec9ae2577ce34ab01f2d213b99d07e1">More...</a><br /></td></tr>
<tr class="separator:aeec9ae2577ce34ab01f2d213b99d07e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a427660928e1e0339d497390c167f895c"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timing_8h.html#a427660928e1e0339d497390c167f895c">mbedtls_timing_get_timer</a> (struct <a class="el" href="structmbedtls__timing__hr__time.html">mbedtls_timing_hr_time</a> *val, int reset)</td></tr>
<tr class="memdesc:a427660928e1e0339d497390c167f895c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the elapsed time in milliseconds.  <a href="#a427660928e1e0339d497390c167f895c">More...</a><br /></td></tr>
<tr class="separator:a427660928e1e0339d497390c167f895c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ea7574e836da0dc51b4b16c4033ede3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timing_8h.html#a7ea7574e836da0dc51b4b16c4033ede3">mbedtls_set_alarm</a> (int seconds)</td></tr>
<tr class="memdesc:a7ea7574e836da0dc51b4b16c4033ede3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Setup an alarm clock.  <a href="#a7ea7574e836da0dc51b4b16c4033ede3">More...</a><br /></td></tr>
<tr class="separator:a7ea7574e836da0dc51b4b16c4033ede3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb3497ab85adabf7db89d81c34e2ef92"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timing_8h.html#aeb3497ab85adabf7db89d81c34e2ef92">mbedtls_timing_set_delay</a> (void *data, uint32_t int_ms, uint32_t fin_ms)</td></tr>
<tr class="memdesc:aeb3497ab85adabf7db89d81c34e2ef92"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a pair of delays to watch (See <code><a class="el" href="timing_8h.html#afb1705e8c4227b0ec03089aa7fc54d9b" title="Get the status of delays (Memory helper: number of delays passed.) ">mbedtls_timing_get_delay()</a></code>.)  <a href="#aeb3497ab85adabf7db89d81c34e2ef92">More...</a><br /></td></tr>
<tr class="separator:aeb3497ab85adabf7db89d81c34e2ef92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb1705e8c4227b0ec03089aa7fc54d9b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timing_8h.html#afb1705e8c4227b0ec03089aa7fc54d9b">mbedtls_timing_get_delay</a> (void *data)</td></tr>
<tr class="memdesc:afb1705e8c4227b0ec03089aa7fc54d9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the status of delays (Memory helper: number of delays passed.)  <a href="#afb1705e8c4227b0ec03089aa7fc54d9b">More...</a><br /></td></tr>
<tr class="separator:afb1705e8c4227b0ec03089aa7fc54d9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa832a2e14723215d909150c337199f53"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timing_8h.html#aa832a2e14723215d909150c337199f53">mbedtls_timing_self_test</a> (int verbose)</td></tr>
<tr class="memdesc:aa832a2e14723215d909150c337199f53"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checkup routine.  <a href="#aa832a2e14723215d909150c337199f53">More...</a><br /></td></tr>
<tr class="separator:aa832a2e14723215d909150c337199f53"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:af5df1e20d5197a5af9f5daba5b6ca654"><td class="memItemLeft" align="right" valign="top">volatile int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timing_8h.html#af5df1e20d5197a5af9f5daba5b6ca654">mbedtls_timing_alarmed</a></td></tr>
<tr class="separator:af5df1e20d5197a5af9f5daba5b6ca654"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Portable interface to timeouts and to the CPU cycle counter. </p>

<p class="definition">Definition in file <a class="el" href="timing_8h_source.html">timing.h</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a7ea7574e836da0dc51b4b16c4033ede3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ea7574e836da0dc51b4b16c4033ede3">&#9670;&nbsp;</a></span>mbedtls_set_alarm()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mbedtls_set_alarm </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>seconds</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Setup an alarm clock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">seconds</td><td>delay before the "mbedtls_timing_alarmed" flag is set (must be &gt;=0)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>Only one alarm at a time is supported. In a threaded context, this means one for the whole process, not one per thread. </dd></dl>

</div>
</div>
<a id="afb1705e8c4227b0ec03089aa7fc54d9b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb1705e8c4227b0ec03089aa7fc54d9b">&#9670;&nbsp;</a></span>mbedtls_timing_get_delay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mbedtls_timing_get_delay </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the status of delays (Memory helper: number of delays passed.) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>Pointer to timing data Must point to a valid <code><a class="el" href="structmbedtls__timing__delay__context.html" title="Context for mbedtls_timing_set/get_delay() ">mbedtls_timing_delay_context</a></code> struct.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-1 if cancelled (fin_ms = 0), 0 if none of the delays are passed, 1 if only the intermediate delay is passed, 2 if the final delay is passed. </dd></dl>

</div>
</div>
<a id="a427660928e1e0339d497390c167f895c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a427660928e1e0339d497390c167f895c">&#9670;&nbsp;</a></span>mbedtls_timing_get_timer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned long mbedtls_timing_get_timer </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmbedtls__timing__hr__time.html">mbedtls_timing_hr_time</a> *&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>reset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the elapsed time in milliseconds. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>points to a timer structure </td></tr>
    <tr><td class="paramname">reset</td><td>If 0, query the elapsed time. Otherwise (re)start the timer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Elapsed time since the previous reset in ms. When restarting, this is always 0.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>To initialize a timer, call this function with reset=1. <pre class="fragment">            Determining the elapsed time and resetting the timer is not
            atomic on all platforms, so after the sequence
            `{ get_timer(1); ...; time1 = get_timer(1); ...; time2 =
            get_timer(0) }` the value time1+time2 is only approximately
            the delay since the first reset.</pre> </dd></dl>

</div>
</div>
<a id="aeec9ae2577ce34ab01f2d213b99d07e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeec9ae2577ce34ab01f2d213b99d07e1">&#9670;&nbsp;</a></span>mbedtls_timing_hardclock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned long mbedtls_timing_hardclock </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the CPU cycle counter value. </p>
<dl class="section warning"><dt>Warning</dt><dd>This is only a best effort! Do not rely on this! In particular, it is known to be unreliable on virtual machines.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This value starts at an unspecified origin and may wrap around. </dd></dl>

</div>
</div>
<a id="aa832a2e14723215d909150c337199f53"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa832a2e14723215d909150c337199f53">&#9670;&nbsp;</a></span>mbedtls_timing_self_test()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mbedtls_timing_self_test </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>verbose</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checkup routine. </p>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or 1 if a test failed </dd></dl>

</div>
</div>
<a id="aeb3497ab85adabf7db89d81c34e2ef92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb3497ab85adabf7db89d81c34e2ef92">&#9670;&nbsp;</a></span>mbedtls_timing_set_delay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mbedtls_timing_set_delay </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>int_ms</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>fin_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set a pair of delays to watch (See <code><a class="el" href="timing_8h.html#afb1705e8c4227b0ec03089aa7fc54d9b" title="Get the status of delays (Memory helper: number of delays passed.) ">mbedtls_timing_get_delay()</a></code>.) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>Pointer to timing data. Must point to a valid <code><a class="el" href="structmbedtls__timing__delay__context.html" title="Context for mbedtls_timing_set/get_delay() ">mbedtls_timing_delay_context</a></code> struct. </td></tr>
    <tr><td class="paramname">int_ms</td><td>First (intermediate) delay in milliseconds. The effect if int_ms &gt; fin_ms is unspecified. </td></tr>
    <tr><td class="paramname">fin_ms</td><td>Second (final) delay in milliseconds. Pass 0 to cancel the current delay.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>To set a single delay, either use <code>mbedtls_timing_set_timer</code> directly or use this function with int_ms == fin_ms. </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="af5df1e20d5197a5af9f5daba5b6ca654"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af5df1e20d5197a5af9f5daba5b6ca654">&#9670;&nbsp;</a></span>mbedtls_timing_alarmed</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">volatile int mbedtls_timing_alarmed</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue May 8 2018 21:08:42 for mbed TLS v2.7.3 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>