Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > 07dfcfe50d66c9a48a3c5e6c1693f12a > files > 1729

cryptopp-doc-5.6.1-0.1.svn479.fc13.i686.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"/>
<title>Crypto++: fips140.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>fips140.h</h1><a href="fips140_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_FIPS140_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_FIPS140_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">/*! \file</span>
<a name="l00005"></a>00005 <span class="comment">        FIPS 140 related functions and classes.</span>
<a name="l00006"></a>00006 <span class="comment">*/</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="cryptlib_8h.html">cryptlib.h</a>&quot;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;secblock.h&quot;</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 NAMESPACE_BEGIN(CryptoPP)
<a name="l00012"></a>00012 
<a name="l00013"></a>00013 <span class="comment">//! exception thrown when a crypto algorithm is used after a self test fails</span>
<a name="l00014"></a><a class="code" href="class_self_test_failure.html">00014</a> <span class="comment"></span>class CRYPTOPP_DLL <a class="code" href="class_self_test_failure.html" title="exception thrown when a crypto algorithm is used after a self test fails">SelfTestFailure</a> : public <a class="code" href="class_exception.html" title="base class for all exceptions thrown by Crypto++">Exception</a>
<a name="l00015"></a>00015 {
<a name="l00016"></a>00016 <span class="keyword">public</span>:
<a name="l00017"></a>00017         <span class="keyword">explicit</span> <a class="code" href="class_self_test_failure.html" title="exception thrown when a crypto algorithm is used after a self test fails">SelfTestFailure</a>(<span class="keyword">const</span> std::string &amp;s) : Exception(OTHER_ERROR, s) {}
<a name="l00018"></a>00018 };
<a name="l00019"></a>00019 <span class="comment"></span>
<a name="l00020"></a>00020 <span class="comment">//! returns whether FIPS 140-2 compliance features were enabled at compile time</span>
<a name="l00021"></a>00021 <span class="comment"></span>CRYPTOPP_DLL <span class="keywordtype">bool</span> CRYPTOPP_API FIPS_140_2_ComplianceEnabled();
<a name="l00022"></a>00022 <span class="comment"></span>
<a name="l00023"></a>00023 <span class="comment">//! enum values representing status of the power-up self test</span>
<a name="l00024"></a><a class="code" href="fips140_8h.html#a8ccac50ac3bfc5abaa6cb457f0ded35d">00024</a> <span class="comment"></span><span class="keyword">enum</span> <a class="code" href="fips140_8h.html#a8ccac50ac3bfc5abaa6cb457f0ded35d" title="enum values representing status of the power-up self test">PowerUpSelfTestStatus</a> {POWER_UP_SELF_TEST_NOT_DONE, POWER_UP_SELF_TEST_FAILED, POWER_UP_SELF_TEST_PASSED};
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment">//! perform the power-up self test, and set the self test status</span>
<a name="l00027"></a>00027 <span class="comment"></span>CRYPTOPP_DLL <span class="keywordtype">void</span> CRYPTOPP_API <a class="code" href="fips140_8h.html#afbf72ca41794ab8c4be31b31070a903f" title="perform the power-up self test, and set the self test status">DoPowerUpSelfTest</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *moduleFilename, <span class="keyword">const</span> byte *expectedModuleMac);
<a name="l00028"></a>00028 <span class="comment"></span>
<a name="l00029"></a>00029 <span class="comment">//! perform the power-up self test using the filename of this DLL and the embedded module MAC</span>
<a name="l00030"></a>00030 <span class="comment"></span>CRYPTOPP_DLL <span class="keywordtype">void</span> CRYPTOPP_API <a class="code" href="fips140_8h.html#a0391333183b583a192abc0184483ae38" title="perform the power-up self test using the filename of this DLL and the embedded module...">DoDllPowerUpSelfTest</a>();
<a name="l00031"></a>00031 <span class="comment"></span>
<a name="l00032"></a>00032 <span class="comment">//! set the power-up self test status to POWER_UP_SELF_TEST_FAILED</span>
<a name="l00033"></a>00033 <span class="comment"></span>CRYPTOPP_DLL <span class="keywordtype">void</span> CRYPTOPP_API SimulatePowerUpSelfTestFailure();
<a name="l00034"></a>00034 <span class="comment"></span>
<a name="l00035"></a>00035 <span class="comment">//! return the current power-up self test status</span>
<a name="l00036"></a>00036 <span class="comment"></span>CRYPTOPP_DLL <a class="code" href="fips140_8h.html#a8ccac50ac3bfc5abaa6cb457f0ded35d" title="enum values representing status of the power-up self test">PowerUpSelfTestStatus</a> CRYPTOPP_API GetPowerUpSelfTestStatus();
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="keyword">typedef</span> <a class="code" href="fips140_8h.html#a8ccac50ac3bfc5abaa6cb457f0ded35d" title="enum values representing status of the power-up self test">PowerUpSelfTestStatus</a> (CRYPTOPP_API * PGetPowerUpSelfTestStatus)();
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 CRYPTOPP_DLL <a class="code" href="class_message_authentication_code.html" title="interface for message authentication codes">MessageAuthenticationCode</a> * CRYPTOPP_API NewIntegrityCheckingMAC();
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 CRYPTOPP_DLL <span class="keywordtype">bool</span> CRYPTOPP_API IntegrityCheckModule(<span class="keyword">const</span> <span class="keywordtype">char</span> *moduleFilename, <span class="keyword">const</span> byte *expectedModuleMac, <a class="code" href="class_sec_block.html" title="a block of memory allocated using A">SecByteBlock</a> *pActualMac = NULL, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *pMacFileLocation = NULL);
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="comment">// this is used by Algorithm constructor to allow Algorithm objects to be constructed for the self test</span>
<a name="l00045"></a>00045 <span class="keywordtype">bool</span> PowerUpSelfTestInProgressOnThisThread();
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 <span class="keywordtype">void</span> SetPowerUpSelfTestInProgressOnThisThread(<span class="keywordtype">bool</span> inProgress);
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 <span class="keywordtype">void</span> SignaturePairwiseConsistencyTest(<span class="keyword">const</span> <a class="code" href="class_p_k___signer.html" title="interface for public-key signers">PK_Signer</a> &amp;signer, <span class="keyword">const</span> <a class="code" href="class_p_k___verifier.html" title="interface for public-key signature verifiers">PK_Verifier</a> &amp;verifier);
<a name="l00050"></a>00050 <span class="keywordtype">void</span> EncryptionPairwiseConsistencyTest(<span class="keyword">const</span> <a class="code" href="class_p_k___encryptor.html" title="interface for public-key encryptors">PK_Encryptor</a> &amp;encryptor, <span class="keyword">const</span> <a class="code" href="class_p_k___decryptor.html" title="interface for public-key decryptors">PK_Decryptor</a> &amp;decryptor);
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="keywordtype">void</span> SignaturePairwiseConsistencyTest_FIPS_140_Only(<span class="keyword">const</span> <a class="code" href="class_p_k___signer.html" title="interface for public-key signers">PK_Signer</a> &amp;signer, <span class="keyword">const</span> <a class="code" href="class_p_k___verifier.html" title="interface for public-key signature verifiers">PK_Verifier</a> &amp;verifier);
<a name="l00053"></a>00053 <span class="keywordtype">void</span> EncryptionPairwiseConsistencyTest_FIPS_140_Only(<span class="keyword">const</span> <a class="code" href="class_p_k___encryptor.html" title="interface for public-key encryptors">PK_Encryptor</a> &amp;encryptor, <span class="keyword">const</span> <a class="code" href="class_p_k___decryptor.html" title="interface for public-key decryptors">PK_Decryptor</a> &amp;decryptor);
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="preprocessor">#define CRYPTOPP_DUMMY_DLL_MAC &quot;MAC_51f34b8db820ae8&quot;</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span>
<a name="l00057"></a>00057 NAMESPACE_END
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 9 Dec 2009 for Crypto++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>