<!-- HTML header for doxygen 1.8.10-->
<!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.14"/>
<title>Intel® Enhanced Privacy ID SDK: Building from Source</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="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="epidstyle.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"><a
onclick="storeLink('index.html')"
id="projectlink"
class="index.html"
href="index.html">Intel® Enhanced Privacy ID SDK</a>
 <span id="projectnumber">6.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
</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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_building_sdk.html','');});
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">Building from Source </div> </div>
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#BuildingSdk_Prerequisites">Prerequisites</a></li>
<li class="level1"><a href="#BuildingSdk_Building_SCons">Building SDK with SCons</a></li>
<li class="level1"><a href="#BuildingSdk_Building_Makefile">Alternate Makefile Based Build Approach</a></li>
<li class="level1"><a href="#BuildingSdk_CommercialIpp">Improving Performance with Commercial IPP</a></li>
<li class="level1"><a href="#BuildingSdk_Tiny">Optimizing for Code Size</a><ul><li class="level2"><a href="#implementation_TinyLimitations">Limitations</a></li>
</ul>
</li>
<li class="level1"><a href="#BuildingSdk_Examples">Example Programs</a></li>
<li class="level1"><a href="#BuildingSdk_PortingBuildSystem">Building with Other Build Systems</a></li>
</ul>
</div>
<div class="textblock"><p>To use the SDK in a project, the code from the SDK must be included in that project. The easiest way to do this is to link to static libraries. The SDK comes with build scripts to build static libraries for common environments.</p>
<h1><a class="anchor" id="BuildingSdk_Prerequisites"></a>
Prerequisites</h1>
<p>Building SDK code out of the box requires a number of tools. This section lists the tools used to build the SDK.</p>
<p>For more information on how to install these tools, refer to <a class="el" href="_build_tools_installation.html">Guide to Installing Build Tools</a>.</p>
<p>For a list of compilers and libraries that the SDK was validated on, refer to <a class="el" href="_how_validated.html#validated_supported_compilers">Tested Libraries and Compilers</a>.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Prerequisite </th><th class="markdownTableHeadNone">Notes -----------------------------— </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone">A C/C++ compiler </td><td class="markdownTableBodyNone">Core code in C. Unit tests need C++11 support. </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a href="http://www.python.org">Python</a> </td><td class="markdownTableBodyNone">Validated with v2.7.12 </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><a href="http://www.scons.org">SCons</a> </td><td class="markdownTableBodyNone">Validated with v2.4.1 </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><a href="https://bitbucket.org/sconsparts/parts">Parts</a> </td><td class="markdownTableBodyNone">0.11.0 or later </td></tr>
</table>
<h1><a class="anchor" id="BuildingSdk_Building_SCons"></a>
Building SDK with SCons</h1>
<p>To use the SDK, you need to build it to generate libraries compatible with your build environment.</p>
<p>To build based on the default SConstruct file in the root directory of the SDK, invoke scons with no arguments. </p><pre class="fragment">cd <path/to/sdk-root>
scons
</pre><p>By default, this performs a release build of the SDK with unit tests for the current platform and runs unit tests.</p>
<p>To skip unit test execution when doing cross platform build use: </p><pre class="fragment">scons build:: utest::
</pre><p>Built components appear in the <code>_install</code> directory of the SDK root.</p>
<p>Potentially useful command line options:</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Option </th><th class="markdownTableHeadNone">Action -----------------------— </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>--cfg=debug</code> </td><td class="markdownTableBodyNone">Build in debug mode </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>--cfg=release</code> </td><td class="markdownTableBodyNone">Build in release mode </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>--target=x86</code> </td><td class="markdownTableBodyNone">Target x86 (i386) architecture </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>--target=x86_64</code> </td><td class="markdownTableBodyNone">Target x86-64 architecture </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>--target=arm</code> </td><td class="markdownTableBodyNone">Target 32-bit ARM architecture </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>--target=arm_hf</code> </td><td class="markdownTableBodyNone">Target 32-bit ARM architecture with hard float ABI </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>--target=aarch64</code> </td><td class="markdownTableBodyNone">Target AArch64 (64-bit ARM) architecture </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>--tc=cl</code> </td><td class="markdownTableBodyNone">Use MSVC to compile (Microsoft®* C/C++ Compiler) </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>--tc=gcc</code> </td><td class="markdownTableBodyNone">Use GCC to compile (GNU* Compiler Collection) </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>--tc=icl,mstools</code> </td><td class="markdownTableBodyNone">Use Intel® C++ compiler for Windows </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>--tc=icc,gnutools</code> </td><td class="markdownTableBodyNone">Use Intel® C++ compiler for Linux </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>build::</code> </td><td class="markdownTableBodyNone">Build the SDK (does not build unit tests) </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>utest::</code> </td><td class="markdownTableBodyNone">Build unit tests </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>run_utest::</code> </td><td class="markdownTableBodyNone">Run unit tests (builds tests if needed) </td></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>-c</code> </td><td class="markdownTableBodyNone">Clean the build </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>-j N</code> or <code>--jobs=N</code> </td><td class="markdownTableBodyNone">Allow N jobs at once </td></tr>
</table>
<h1><a class="anchor" id="BuildingSdk_Building_Makefile"></a>
Alternate Makefile Based Build Approach</h1>
<p>You can build with the <code>make</code> command on platforms that support Make/Autoconf.</p>
<p>In the root directory of the SDK, run: </p><pre class="fragment">./configure
make all
make check
make install
</pre><p><code>./configure</code> sets up the default settings:</p>
<ul>
<li>The default compilers are GCC/G++. You can specify compilers via the CC and CXX variables. For example, <code>./configure CC=/opt/intel/bin/icc CXX=/opt/intel/bin/icpc</code></li>
<li>The default installation directory is <code>./_install</code>. You can specify the installation directory by using <code>./configure --prefix=/usr/local/epid_install</code></li>
<li>The default target matches the current environment. You may change it with the CFLAGS parameter. For example, <code>./configure CFLAGS=-m32</code> when run on x86_64 environment configures compilation to target x86.</li>
</ul>
<p><code>make check</code> is optional. It builds and runs the unit tests.</p>
<p>Alternatively, you can use <code>make build</code> as a shortcut to replace <code>make all</code>, <code>make check</code>, and <code>make install</code>.</p>
<p>To run N jobs at once use the <code>-j N</code> or <code>--jobs=N</code> option with the <code>make</code> command, e.g. <code>make all -j 4</code> will allow make to create 4 jobs at once.</p>
<p>To clean the build, run <code>make clean</code>.</p>
<p>To remove the install directory, run <code>make uninstall</code>.</p>
<p>To configure cross compilation use <code>--host</code> option. For example, <code>./configure --host=arm-linux-gnueabi</code> configures cross compilation build targeting ARM architecture. Cross compiled tests will not run on the build machine so <code>make check</code> should be replaced to <code>make utest</code>. A typical build sequence for cross compilation is as follows: </p><pre class="fragment">./configure --host=<target system>
make all
make utest
make install
</pre><h1><a class="anchor" id="BuildingSdk_CommercialIpp"></a>
Improving Performance with Commercial IPP</h1>
<p>For higher performance, you can use the commercial version of Cryptography for Intel® Integrated Performance Primitives, available at <a href="https://software.intel.com/get-ipp-cryptography-libraries">https://software.intel.com/get-ipp-cryptography-libraries</a>.</p>
<dl class="section note"><dt>Note</dt><dd>The SDK has been validated with version 2018 (Update 2.1) of the cryptography library.</dd></dl>
<p>To build the SDK using a commercial Intel® IPP installation, the <code>IPPCRYPTOROOT</code> environment variable must be properly configured to point to the IPP installation directory, as described in <em>Setting Environment Variables</em> in the <a href="https://software.intel.com/ipp-crypto-dev-guide-setting-environment-variables">Intel® IPP Crypto Developer Guide</a>.</p>
<p>Once the environment is configured, you can build using commercial IPP by specifying <code>--use-commercial-ipp</code> as a command line option.</p>
<h1><a class="anchor" id="BuildingSdk_Tiny"></a>
Optimizing for Code Size</h1>
<p>To build the SDK with a member with substantially reduced code size, you can use tiny mode.</p>
<p>To build with SCons, go to the root directory of the SDK and run: </p><pre class="fragment">scons --prod-var=tiny
</pre><p>To build with Make, go to the root directory of the SDK and run: </p><pre class="fragment">./configure --enable-tiny
make all
make check
make install
</pre><h2><a class="anchor" id="implementation_TinyLimitations"></a>
Limitations</h2>
<p>By design, a member built in tiny mode has the following limitations:</p>
<ul>
<li>TPM mode is not supported.</li>
<li>Only SHA-256 and SHA-512 are supported.</li>
<li>Signature pre-computation is not supported.</li>
<li>Compressed keys are not supported.</li>
<li>Commercial IPP cannot be used.</li>
<li>The implementation prioritizes size over performance.</li>
</ul>
<h1><a class="anchor" id="BuildingSdk_Examples"></a>
Example Programs</h1>
<p>The SDK includes several examples that show you different aspects of how the Intel® EPID scheme works. In the SDK build, these examples are located in <code>_install/epid-sdk/example</code>.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Name </th><th class="markdownTableHeadNone">Description ----------— </th></tr>
<tr class="markdownTableBody" class="markdownTableRowOdd">
<td class="markdownTableBodyNone"><code>signmsg</code> </td><td class="markdownTableBodyNone">Create Intel® EPID signature of message </td></tr>
<tr class="markdownTableBody" class="markdownTableRowEven">
<td class="markdownTableBodyNone"><code>verifysig</code> </td><td class="markdownTableBodyNone">Verify signature is from a group member in good standing </td></tr>
</table>
<h1><a class="anchor" id="BuildingSdk_PortingBuildSystem"></a>
Building with Other Build Systems</h1>
<p>It is relatively straightforward to port the SDK to your build system of choice. The following dependency diagram shows the relationship between components and the sources used to build them.</p>
<div class="image">
<img src="basicdoc.png" alt="basicdoc.png"/>
</div>
<p><br />
</p>
<p>*Other names and brands may be claimed as the property of others. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">
© 2016-2017 Intel Corporation
</li>
</ul>
</div>
</body>
</html>