MCUXpresso_LPC55S69/docs/MCUXpresso SDK API Referenc.../a00034.html

460 lines
34 KiB
HTML

<!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.5"/>
<title>MCUXpresso SDK API Reference Manual: IAP_KBP Driver</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.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="projectlogo"><img alt="Logo" src="fs_logo.gif"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">MCUXpresso SDK API Reference Manual
&#160;<span id="projectnumber">Rev 2.15.000</span>
</div>
<div id="projectbrief">NXP Semiconductors</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>API&#160;Reference</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('a00034.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">IAP_KBP Driver<div class="ingroups"><a class="el" href="a00018.html">IAP: In Application Programming Driver</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<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:a00356"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a00356">_kb_region</a></td></tr>
<tr class="memdesc:a00356"><td class="mdescLeft">&#160;</td><td class="mdescRight">Memory region definition. <a href="a00034.html#a00356">More...</a><br/></td></tr>
<tr class="separator:a00356"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00355"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a00355">_kb_load_sb</a></td></tr>
<tr class="memdesc:a00355"><td class="mdescLeft">&#160;</td><td class="mdescRight">User-provided options passed into <a class="el" href="a00034.html#ga5f9b4a7f5766e62a6352d9c36a929465" title="Initialize ROM API for a given operation. ">kb_init()</a>. <a href="a00034.html#a00355">More...</a><br/></td></tr>
<tr class="separator:a00355"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00365"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a00365">_memory_region_interface</a></td></tr>
<tr class="memdesc:a00365"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interface to memory operations for one region of memory. <a href="a00034.html#a00365">More...</a><br/></td></tr>
<tr class="separator:a00365"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00364"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#a00364">_memory_map_entry</a></td></tr>
<tr class="memdesc:a00364"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure of a memory map entry. <a href="a00034.html#a00364">More...</a><br/></td></tr>
<tr class="separator:a00364"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga2f6872bd7834242f19fe55d3006756fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2f6872bd7834242f19fe55d3006756fd"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga2f6872bd7834242f19fe55d3006756fd">kStatusGroup_RomApi</a>&#160;&#160;&#160;(108U)</td></tr>
<tr class="memdesc:ga2f6872bd7834242f19fe55d3006756fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">ROM API status group number. <br/></td></tr>
<tr class="separator:ga2f6872bd7834242f19fe55d3006756fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gaf3d735bece2ebc5268e4c5453257ed1f"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="a00034.html#ga4580cee4f95179434414d5c959d4891a">_kb_operation</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#gaf3d735bece2ebc5268e4c5453257ed1f">kb_operation_t</a></td></tr>
<tr class="memdesc:gaf3d735bece2ebc5268e4c5453257ed1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Details of the operation to be performed by the ROM. <a href="#gaf3d735bece2ebc5268e4c5453257ed1f">More...</a><br/></td></tr>
<tr class="separator:gaf3d735bece2ebc5268e4c5453257ed1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga24a4ef760fed5f8f1e83fd753057387b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga24a4ef760fed5f8f1e83fd753057387b"></a>
typedef struct <a class="el" href="a00034.html#a00356">_kb_region</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga24a4ef760fed5f8f1e83fd753057387b">kb_region_t</a></td></tr>
<tr class="memdesc:ga24a4ef760fed5f8f1e83fd753057387b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Memory region definition. <br/></td></tr>
<tr class="separator:ga24a4ef760fed5f8f1e83fd753057387b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf136d8a683a753cabb3f5e67e394373e"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="a00034.html#a00355">_kb_load_sb</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#gaf136d8a683a753cabb3f5e67e394373e">kb_load_sb_t</a></td></tr>
<tr class="memdesc:gaf136d8a683a753cabb3f5e67e394373e"><td class="mdescLeft">&#160;</td><td class="mdescRight">User-provided options passed into <a class="el" href="a00034.html#ga5f9b4a7f5766e62a6352d9c36a929465" title="Initialize ROM API for a given operation. ">kb_init()</a>. <a href="#gaf136d8a683a753cabb3f5e67e394373e">More...</a><br/></td></tr>
<tr class="separator:gaf136d8a683a753cabb3f5e67e394373e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3fa7251fa69dc7a652e86541d8414f3d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3fa7251fa69dc7a652e86541d8414f3d"></a>
typedef struct <br class="typebreak"/>
<a class="el" href="a00034.html#a00365">_memory_region_interface</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga3fa7251fa69dc7a652e86541d8414f3d">memory_region_interface_t</a></td></tr>
<tr class="memdesc:ga3fa7251fa69dc7a652e86541d8414f3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interface to memory operations for one region of memory. <br/></td></tr>
<tr class="separator:ga3fa7251fa69dc7a652e86541d8414f3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga203b35c02c0cf762ffbb8783d35be7aa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga203b35c02c0cf762ffbb8783d35be7aa"></a>
typedef struct <a class="el" href="a00034.html#a00364">_memory_map_entry</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga203b35c02c0cf762ffbb8783d35be7aa">memory_map_entry_t</a></td></tr>
<tr class="memdesc:ga203b35c02c0cf762ffbb8783d35be7aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure of a memory map entry. <br/></td></tr>
<tr class="separator:ga203b35c02c0cf762ffbb8783d35be7aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gaaf105ae5beaca1dee30ae54530691fce"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <br/>
&#160;&#160;<a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea343daee358f4d733cce97d0f10093a59">kStatus_RomApiExecuteCompleted</a> = kStatus_Success,
<br/>
&#160;&#160;<a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea1e6d2a8f8fe94cc1b0f0b575154bb232">kStatus_RomApiNeedMoreData</a>,
<br/>
&#160;&#160;<a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea2d917ef1b351dc5d62d01b2bd83e7d7f">kStatus_RomApiBufferSizeNotEnough</a>,
<br/>
&#160;&#160;<a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea9b8ea7f097f5ac77e15187e0862916f7">kStatus_RomApiInvalidBuffer</a>
<br/>
}</td></tr>
<tr class="memdesc:gaaf105ae5beaca1dee30ae54530691fce"><td class="mdescLeft">&#160;</td><td class="mdescRight">ROM API status codes. <a href="a00034.html#gaaf105ae5beaca1dee30ae54530691fce">More...</a><br/></td></tr>
<tr class="separator:gaaf105ae5beaca1dee30ae54530691fce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4580cee4f95179434414d5c959d4891a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga4580cee4f95179434414d5c959d4891a">_kb_operation</a> { <br/>
&#160;&#160;<a class="el" href="a00034.html#gga4580cee4f95179434414d5c959d4891aae426f3ed5a9db291df99023ebe7f7929">kRomAuthenticateImage</a> = 1,
<br/>
&#160;&#160;<a class="el" href="a00034.html#gga4580cee4f95179434414d5c959d4891aa6f2cf7f2f264990d318fe907d8c20872">kRomLoadImage</a> = 2
<br/>
}</td></tr>
<tr class="memdesc:ga4580cee4f95179434414d5c959d4891a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Details of the operation to be performed by the ROM. <a href="a00034.html#ga4580cee4f95179434414d5c959d4891a">More...</a><br/></td></tr>
<tr class="separator:ga4580cee4f95179434414d5c959d4891a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga23af9bdeff3f87cbbbec1c418614f51f"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga23af9bdeff3f87cbbbec1c418614f51f">_kb_security_profile</a> </td></tr>
<tr class="memdesc:ga23af9bdeff3f87cbbbec1c418614f51f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Security constraint flags, Security profile flags. <br/></td></tr>
<tr class="separator:ga23af9bdeff3f87cbbbec1c418614f51f"><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:ga5f9b4a7f5766e62a6352d9c36a929465"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00242.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga5f9b4a7f5766e62a6352d9c36a929465">kb_init</a> (kb_session_ref_t **session, const kb_options_t *options)</td></tr>
<tr class="memdesc:ga5f9b4a7f5766e62a6352d9c36a929465"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize ROM API for a given operation. <a href="#ga5f9b4a7f5766e62a6352d9c36a929465">More...</a><br/></td></tr>
<tr class="separator:ga5f9b4a7f5766e62a6352d9c36a929465"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7ecd834f6e019fb55cdcb80176c590e7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00242.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga7ecd834f6e019fb55cdcb80176c590e7">kb_deinit</a> (kb_session_ref_t *session)</td></tr>
<tr class="memdesc:ga7ecd834f6e019fb55cdcb80176c590e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cleans up the ROM API context. <a href="#ga7ecd834f6e019fb55cdcb80176c590e7">More...</a><br/></td></tr>
<tr class="separator:ga7ecd834f6e019fb55cdcb80176c590e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga589fc0e337a92696431dea7ea91c1fd8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00242.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00034.html#ga589fc0e337a92696431dea7ea91c1fd8">kb_execute</a> (kb_session_ref_t *session, const uint8_t *data, uint32_t dataLength)</td></tr>
<tr class="memdesc:ga589fc0e337a92696431dea7ea91c1fd8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform the operation configured during init. <a href="#ga589fc0e337a92696431dea7ea91c1fd8">More...</a><br/></td></tr>
<tr class="separator:ga589fc0e337a92696431dea7ea91c1fd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="a00356" id="a00356"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct _kb_region</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"></div>
</div>
</div>
<a name="a00355" id="a00355"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct _kb_load_sb</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>The buffer field is a pointer to memory provided by the caller for use by Kboot during execution of the operation. Minimum size is the size of each certificate in the chain plus 432 bytes additional per certificate.</p>
<p>The profile field is a mask that specifies which features are required in the SB file or image being processed. This includes the minimum AES and RSA key sizes. See the _kb_security_profile enum for profile mask constants. The image being loaded or authenticated must match the profile or an error will be returned.</p>
<p>minBuildNumber is an optional field that can be used to prevent version rollback. The API will check the build number of the image, and if it is less than minBuildNumber will fail with an error.</p>
<p>maxImageLength is used to verify the offsetToCertificateBlockHeaderInBytes value at the beginning of a signed image. It should be set to the length of the SB file. If verifying an image in flash, it can be set to the internal flash size or a large number like 0x10000000.</p>
<p>userRHK can optionally be used by the user to override the RHK in IFR. If userRHK is not NULL, it points to a 32-byte array containing the SHA-256 of the root certificate's RSA public key.</p>
<p>The regions field points to an array of memory regions that the SB file being loaded is allowed to access. If regions is NULL, then all memory is accessible by the SB file. This feature is required to prevent a malicious image from erasing good code or RAM contents while it is being loaded, only for us to find that the image is inauthentic when we hit the end of the section.</p>
<p>overrideSBBootSectionID lets the caller override the default section of the SB file that is processed during a kKbootLoadSB operation. By default, the section specified in the firstBootableSectionID field of the SB header is loaded. If overrideSBBootSectionID is non-zero, then the section with the given ID will be loaded instead.</p>
<p>The userSBKEK field lets a user provide their own AES-256 key for unwrapping keys in an SB file during the kKbootLoadSB operation. userSBKEK should point to a 32-byte AES-256 key. If userSBKEK is NULL then the IFR SBKEK will be used. After <a class="el" href="a00034.html#ga5f9b4a7f5766e62a6352d9c36a929465" title="Initialize ROM API for a given operation. ">kb_init()</a> returns, the caller should zero out the data pointed to by userSBKEK, as the API will have installed the key in the CAU3. </p>
</div>
</div>
</div>
<a name="a00365" id="a00365"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct _memory_region_interface</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"></div>
</div>
</div>
<a name="a00364" id="a00364"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct _memory_map_entry</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"></div>
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="gaf3d735bece2ebc5268e4c5453257ed1f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef enum <a class="el" href="a00034.html#ga4580cee4f95179434414d5c959d4891a">_kb_operation</a> <a class="el" href="a00034.html#gaf3d735bece2ebc5268e4c5453257ed1f">kb_operation_t</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The <a class="el" href="a00034.html#gga4580cee4f95179434414d5c959d4891aae426f3ed5a9db291df99023ebe7f7929" title="Authenticate a signed image. ">kRomAuthenticateImage</a> operation requires the entire signed image to be available to the application. </p>
</div>
</div>
<a class="anchor" id="gaf136d8a683a753cabb3f5e67e394373e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="a00034.html#a00355">_kb_load_sb</a> <a class="el" href="a00034.html#gaf136d8a683a753cabb3f5e67e394373e">kb_load_sb_t</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The buffer field is a pointer to memory provided by the caller for use by Kboot during execution of the operation. Minimum size is the size of each certificate in the chain plus 432 bytes additional per certificate.</p>
<p>The profile field is a mask that specifies which features are required in the SB file or image being processed. This includes the minimum AES and RSA key sizes. See the _kb_security_profile enum for profile mask constants. The image being loaded or authenticated must match the profile or an error will be returned.</p>
<p>minBuildNumber is an optional field that can be used to prevent version rollback. The API will check the build number of the image, and if it is less than minBuildNumber will fail with an error.</p>
<p>maxImageLength is used to verify the offsetToCertificateBlockHeaderInBytes value at the beginning of a signed image. It should be set to the length of the SB file. If verifying an image in flash, it can be set to the internal flash size or a large number like 0x10000000.</p>
<p>userRHK can optionally be used by the user to override the RHK in IFR. If userRHK is not NULL, it points to a 32-byte array containing the SHA-256 of the root certificate's RSA public key.</p>
<p>The regions field points to an array of memory regions that the SB file being loaded is allowed to access. If regions is NULL, then all memory is accessible by the SB file. This feature is required to prevent a malicious image from erasing good code or RAM contents while it is being loaded, only for us to find that the image is inauthentic when we hit the end of the section.</p>
<p>overrideSBBootSectionID lets the caller override the default section of the SB file that is processed during a kKbootLoadSB operation. By default, the section specified in the firstBootableSectionID field of the SB header is loaded. If overrideSBBootSectionID is non-zero, then the section with the given ID will be loaded instead.</p>
<p>The userSBKEK field lets a user provide their own AES-256 key for unwrapping keys in an SB file during the kKbootLoadSB operation. userSBKEK should point to a 32-byte AES-256 key. If userSBKEK is NULL then the IFR SBKEK will be used. After <a class="el" href="a00034.html#ga5f9b4a7f5766e62a6352d9c36a929465" title="Initialize ROM API for a given operation. ">kb_init()</a> returns, the caller should zero out the data pointed to by userSBKEK, as the API will have installed the key in the CAU3. </p>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="gaaf105ae5beaca1dee30ae54530691fce"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">anonymous enum</td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="ggaaf105ae5beaca1dee30ae54530691fcea343daee358f4d733cce97d0f10093a59"></a>kStatus_RomApiExecuteCompleted</em>&nbsp;</td><td class="fielddoc">
<p>ROM successfully process the whole sb file/boot image. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggaaf105ae5beaca1dee30ae54530691fcea1e6d2a8f8fe94cc1b0f0b575154bb232"></a>kStatus_RomApiNeedMoreData</em>&nbsp;</td><td class="fielddoc">
<p>ROM needs more data to continue processing the boot image. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggaaf105ae5beaca1dee30ae54530691fcea2d917ef1b351dc5d62d01b2bd83e7d7f"></a>kStatus_RomApiBufferSizeNotEnough</em>&nbsp;</td><td class="fielddoc">
<p>The user buffer is not enough for use by Kboot during execution of the operation. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggaaf105ae5beaca1dee30ae54530691fcea9b8ea7f097f5ac77e15187e0862916f7"></a>kStatus_RomApiInvalidBuffer</em>&nbsp;</td><td class="fielddoc">
<p>The user buffer is not ok for sbloader or authentication. </p>
</td></tr>
</table>
</div>
</div>
<a class="anchor" id="ga4580cee4f95179434414d5c959d4891a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="a00034.html#ga4580cee4f95179434414d5c959d4891a">_kb_operation</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The <a class="el" href="a00034.html#gga4580cee4f95179434414d5c959d4891aae426f3ed5a9db291df99023ebe7f7929" title="Authenticate a signed image. ">kRomAuthenticateImage</a> operation requires the entire signed image to be available to the application. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga4580cee4f95179434414d5c959d4891aae426f3ed5a9db291df99023ebe7f7929"></a>kRomAuthenticateImage</em>&nbsp;</td><td class="fielddoc">
<p>Authenticate a signed image. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga4580cee4f95179434414d5c959d4891aa6f2cf7f2f264990d318fe907d8c20872"></a>kRomLoadImage</em>&nbsp;</td><td class="fielddoc">
<p>Load SB file. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga5f9b4a7f5766e62a6352d9c36a929465"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00242.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> kb_init </td>
<td>(</td>
<td class="paramtype">kb_session_ref_t **&#160;</td>
<td class="paramname"><em>session</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const kb_options_t *&#160;</td>
<td class="paramname"><em>options</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Inits the ROM API based on the options provided by the application in the second argument. Every call to rom_init() should be paired with a call to rom_deinit().</p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname"><a class="el" href="a00242.html#ggadf764cbdea00d65edcd07bb9953ad2b7a829bee76c6b02225d9c891ae8ef70881" title="Generic status for Success. ">kStatus_Success</a></td><td>API was executed successfully. </td></tr>
<tr><td class="paramname"><a class="el" href="a00242.html#ggadf764cbdea00d65edcd07bb9953ad2b7a9743ab3bec5065667c0b12510317e76c" title="Generic status for invalid argument check. ">kStatus_InvalidArgument</a></td><td>An invalid argument is provided. </td></tr>
<tr><td class="paramname"><a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea2d917ef1b351dc5d62d01b2bd83e7d7f" title="The user buffer is not enough for use by Kboot during execution of the operation. ...">kStatus_RomApiBufferSizeNotEnough</a></td><td>The user buffer is not enough for use by Kboot during execution of the operation. </td></tr>
<tr><td class="paramname"><a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea9b8ea7f097f5ac77e15187e0862916f7" title="The user buffer is not ok for sbloader or authentication. ">kStatus_RomApiInvalidBuffer</a></td><td>The user buffer is not ok for sbloader or authentication. </td></tr>
<tr><td class="paramname"><a class="el" href="a00263.html#gga6bfd6dd9281cf1736444d3d68194fe89a905a486e12679a5223f9824de2fa272d" title="PRINCE Fail. ">kStatus_SKBOOT_Fail</a></td><td>Return the failed status of secure boot. </td></tr>
<tr><td class="paramname"><a class="el" href="a00263.html#gga6bfd6dd9281cf1736444d3d68194fe89a7ca4bc728877b1f6c23e7dcbfa3ccf91" title="PRINCE Invalid marker. ">kStatus_SKBOOT_KeyStoreMarkerInvalid</a></td><td>The key code for the particular PRINCE region is not present in the keystore </td></tr>
<tr><td class="paramname"><a class="el" href="a00263.html#gga6bfd6dd9281cf1736444d3d68194fe89a9f0ca718735dd60c0f6e2e103615f9bc" title="PRINCE Success. ">kStatus_SKBOOT_Success</a></td><td>Return the successful status of secure boot. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga7ecd834f6e019fb55cdcb80176c590e7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00242.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> kb_deinit </td>
<td>(</td>
<td class="paramtype">kb_session_ref_t *&#160;</td>
<td class="paramname"><em>session</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>After this call, the context parameter can be reused for another operation by calling rom_init() again.</p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname"><a class="el" href="a00242.html#ggadf764cbdea00d65edcd07bb9953ad2b7a829bee76c6b02225d9c891ae8ef70881" title="Generic status for Success. ">kStatus_Success</a></td><td>API was executed successfully </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga589fc0e337a92696431dea7ea91c1fd8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00242.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> kb_execute </td>
<td>(</td>
<td class="paramtype">kb_session_ref_t *&#160;</td>
<td class="paramname"><em>session</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const uint8_t *&#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>dataLength</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This application must call this API repeatedly, passing in sequential chunks of data from the boot image (SB file) that is to be processed. The ROM will perform the selected operation on this data and return. The application may call this function with as much or as little data as it wishes, which can be used to select the granularity of time given to the application in between executing the operation.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">session</td><td>Current ROM context pointer. </td></tr>
<tr><td class="paramname">data</td><td>Buffer of boot image data provided to the ROM by the application. </td></tr>
<tr><td class="paramname">dataLength</td><td>Length in bytes of the data in the buffer provided to the ROM.</td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname"><a class="el" href="a00242.html#ggadf764cbdea00d65edcd07bb9953ad2b7a829bee76c6b02225d9c891ae8ef70881" title="Generic status for Success. ">kStatus_Success</a></td><td>ROM successfully process the part of sb file/boot image. </td></tr>
<tr><td class="paramname"><a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea343daee358f4d733cce97d0f10093a59" title="ROM successfully process the whole sb file/boot image. ">kStatus_RomApiExecuteCompleted</a></td><td>ROM successfully process the whole sb file/boot image. </td></tr>
<tr><td class="paramname"><a class="el" href="a00242.html#ggadf764cbdea00d65edcd07bb9953ad2b7a8692e71089c7e81bd5f4503ff55035db" title="Generic status for Fail. ">kStatus_Fail</a></td><td>An error occurred while executing the operation. </td></tr>
<tr><td class="paramname"><a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea1e6d2a8f8fe94cc1b0f0b575154bb232" title="ROM needs more data to continue processing the boot image. ">kStatus_RomApiNeedMoreData</a></td><td>No error occurred, but the ROM needs more data to continue processing the boot image. </td></tr>
<tr><td class="paramname"><a class="el" href="a00034.html#ggaaf105ae5beaca1dee30ae54530691fcea2d917ef1b351dc5d62d01b2bd83e7d7f" title="The user buffer is not enough for use by Kboot during execution of the operation. ...">kStatus_RomApiBufferSizeNotEnough</a></td><td>user buffer is not enough for use by Kboot during execution of the operation. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul class="foot">
<li class="footer">&copy; 2016 NXP Semiconductors. All rights reserved.
</li>
</ul>
</div>
</body>
</html>