📄 fips140_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>Crypto++: fips140.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.2 --><div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.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 List</span></a></li> <li><a href="globals.html"><span>File 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 "<a class="code" href="cryptlib_8h.html">cryptlib.h</a>"</span><a name="l00009"></a>00009 <span class="preprocessor">#include "secblock.h"</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><a class="code" href="class_self_test_failure.html#6ca1bc1253cf4f5aa7f19ef443c295bd">00017</a> <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 &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#8ccac50ac3bfc5abaa6cb457f0ded35d">00024</a> <span class="comment"></span><span class="keyword">enum</span> <a class="code" href="fips140_8h.html#8ccac50ac3bfc5abaa6cb457f0ded35d" title="enum values representing status of the power-up self test">PowerUpSelfTestStatus</a> {<a class="code" href="fips140_8h.html#8ccac50ac3bfc5abaa6cb457f0ded35d50805cb51444d59eb747962fa279ad27">POWER_UP_SELF_TEST_NOT_DONE</a>, <a class="code" href="fips140_8h.html#8ccac50ac3bfc5abaa6cb457f0ded35d7fdf030b911a428fda600038ef914c95">POWER_UP_SELF_TEST_FAILED</a>, <a class="code" href="fips140_8h.html#8ccac50ac3bfc5abaa6cb457f0ded35d6c4f7efa0a4251f4c3a2836abba17877">POWER_UP_SELF_TEST_PASSED</a>};<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#fbf72ca41794ab8c4be31b31070a903f" 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#0391333183b583a192abc0184483ae38" 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#8ccac50ac3bfc5abaa6cb457f0ded35d" 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><a class="code" href="fips140_8h.html#8f3a873bd3fb9eb67f895eeb23f39939">00038</a> <span class="keyword">typedef</span> <a class="code" href="fips140_8h.html#8ccac50ac3bfc5abaa6cb457f0ded35d" title="enum values representing status of the power-up self test">PowerUpSelfTestStatus</a> (CRYPTOPP_API * <a class="code" href="fips140_8h.html#8f3a873bd3fb9eb67f895eeb23f39939">PGetPowerUpSelfTestStatus</a>)();<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 <a class="code" href="fips140_8h.html#766d57f0d6451c714b95ba126258b487">NewIntegrityCheckingMAC</a>();<a name="l00041"></a>00041 <a name="l00042"></a>00042 CRYPTOPP_DLL <span class="keywordtype">bool</span> CRYPTOPP_API <a class="code" href="fips140_8h.html#422b2c96912953afb9b01b7c498baed3">IntegrityCheckModule</a>(<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> <a class="code" href="fips140_8h.html#4324298bf57523064d0866f7fb6d8eef">SignaturePairwiseConsistencyTest</a>(<span class="keyword">const</span> <a class="code" href="class_p_k___signer.html" title="interface for public-key signers">PK_Signer</a> &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> &verifier);<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="fips140_8h.html#5508585427d867fafa5eba22fde6ba7d">EncryptionPairwiseConsistencyTest</a>(<span class="keyword">const</span> <a class="code" href="class_p_k___encryptor.html" title="interface for public-key encryptors">PK_Encryptor</a> &encryptor, <span class="keyword">const</span> <a class="code" href="class_p_k___decryptor.html" title="interface for public-key decryptors">PK_Decryptor</a> &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> &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> &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> &encryptor, <span class="keyword">const</span> <a class="code" href="class_p_k___decryptor.html" title="interface for public-key decryptors">PK_Decryptor</a> &decryptor);<a name="l00054"></a>00054 <a name="l00055"></a><a class="code" href="fips140_8h.html#fa5d25ce1be2e8d1beda9340260a4d77">00055</a> <span class="preprocessor">#define CRYPTOPP_DUMMY_DLL_MAC "MAC_51f34b8db820ae8"</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><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 1 11:11:21 2007 for Crypto++ by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -