1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>intel-ipsec-mb: intel-ipsec-mb</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>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function() { init_search(); });
/* @license-end */
</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 id="projectrow">
<td id="projectalign">
<div id="projectname">intel-ipsec-mb<span id="projectnumber"> v2.0</span>
</div>
<div id="projectbrief">Documentation of the Intel(R) IPSec Multi-Buffer library</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
<input type="text" id="MSearchField" value="" placeholder="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.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</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)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div><div class="header">
<div class="headertitle"><div class="title">intel-ipsec-mb </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md__2home_2mdcornu_2innersource_2libraries_8performance_8ipsec-mb_2README"></a></p>
<h1><a class="anchor" id="autotoc_md0"></a>
Intel(R) Multi-Buffer Crypto for IPsec Library</h1>
<p>The library provides software crypto acceleration primarily targeting packet processing applications. It can be used for application such as: IPsec, TLS, Wireless (RAN), Cable or MPEG DRM.</p>
<p>The library is hosted on <a href="https://github.com/intel/intel-ipsec-mb">GitHub</a> and is used as software crypto provider in <a href="https://www.dpdk.org/">DPDK</a>, <a href="https://github.com/intel/QAT_Engine">Intel(R) QAT Engine</a> and <a href="https://fd.io/">FD.io</a>.</p>
<p>Using crypto interfaces from the above frameworks gives freedom to change providers without subsequent application modifications. The library can also be used directly through its native API.</p>
<p>Key differentiating features:</p>
<ul>
<li>operation chaining (encryption and authentication)</li>
<li>advanced cryptographic pipelining<ul>
<li>job manager with scheduling and dispatching functions</li>
<li>API hides underlying implementation details from an application</li>
</ul>
</li>
<li>multi-buffer and function stitching innovations</li>
<li>low level implementations using latest instruction extensions</li>
</ul>
<h2><a class="anchor" id="autotoc_md1"></a>
Contents</h2>
<ol type="1">
<li>Overview</li>
<li>Processor Extensions</li>
<li>Recommendations</li>
<li>Package Content</li>
<li>Documentation</li>
<li>Compilation</li>
<li>Installation</li>
<li>Security Considerations & Options for Increased Security</li>
<li>Backwards compatibility</li>
<li>Disclaimer (ZUC, KASUMI, SNOW3G)</li>
<li>Legal Disclaimer</li>
<li>FIPS Compliance</li>
<li>DLL Injection</li>
</ol>
<h2><a class="anchor" id="autotoc_md2"></a>
1. Overview</h2>
<p>Intel Multi-Buffer Crypto for IPsec Library is highly-optimized software implementations of the core cryptographic processing for IPsec, which provides industry-leading performance on a range of Intel(R) Processors.</p>
<p>For information on how the library works, see the Intel White Paper: <a href="https://github.com/intel/intel-ipsec-mb/wiki/doc/fast-multi-buffer-ipsec-implementations-ia-processors-paper.pdf">"Fast Multi-buffer IPsec Implementations on Intel Architecture Processors". Jim Guilford, Sean Gulley, et. al.</a></p>
<p>Table 1. List of supported cipher algorithms and their implementations. </p><div class="fragment"><div class="line">+---------------------------------------------------------------------------------------------------+</div>
<div class="line">| | Implementation |</div>
<div class="line">| Encryption +----------------------------------------------------------------------------------|</div>
<div class="line">| | SSE | SSE | SSE | AVX2 | AVX2 | AVX2 | AVX2 | AVX512 | AVX512 |</div>
<div class="line">| | Type 1 | Type 2 | Type 3 | Type 1 | Type 2 | Type 3 | Type 4 | Type 1 | Type 2 |</div>
<div class="line">| | [S1] | [S2] | [S3] | [A2-1] | [A2-2] | [A2-3] | [A2-4] | [A3-1] | [A3-2] |</div>
<div class="line">|----------------+--------+--------+--------+--------+--------+--------+--------+--------+----------|</div>
<div class="line">| AES128-GCM | Y by8 | <--- | <--- | Y by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y by32 |</div>
<div class="line">| AES192-GCM | Y by8 | <--- | <--- | Y by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y by32 |</div>
<div class="line">| AES256-GCM | Y by8 | <--- | <--- | Y by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y by32 |</div>
<div class="line">| AES128-CCM | Y by8 | <--- | <--- | Y by8 | <--- | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| AES256-CCM | Y by8 | <--- | <--- | Y by8 | <--- | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| AES128-CBC | Y(2) | <--- | <--- | Y(2) | <--- | <--- | <--- | <--- | Y(4) |</div>
<div class="line">| AES192-CBC | Y(2) | <--- | <--- | Y(2) | <--- | <--- | <--- | <--- | Y(4) |</div>
<div class="line">| AES256-CBC | Y(2) | <--- | <--- | Y(2) | <--- | <--- | <--- | <--- | Y(4) |</div>
<div class="line">| AES128-CTR | Y by8 | <--- | <--- | Y by8 | Y by16 | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| AES192-CTR | Y by8 | <--- | <--- | Y by8 | Y by16 | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| AES256-CTR | Y by8 | <--- | <--- | Y by8 | Y by16 | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| AES128-ECB | Y by8 | <--- | <--- | Y by8 | Y by16 | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| AES192-ECB | Y by8 | <--- | <--- | Y by8 | Y by16 | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| AES256-ECB | Y by8 | <--- | <--- | Y by8 | Y by16 | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| AES128-CFB | Y(3) | <--- | <--- | <--- | <--- | <--- | <--- | <--- | Y(4) |</div>
<div class="line">| AES192-CFB | Y(3) | <--- | <--- | <--- | <--- | <--- | <--- | <--- | Y(4) |</div>
<div class="line">| AES256-CFB | Y(3) | <--- | <--- | <--- | <--- | <--- | <--- | <--- | Y(4) |</div>
<div class="line">| AES128-DOCSIS | Y(2) | <--- | <--- | Y(2) | <--- | <--- | <--- | Y(2) | Y(4) |</div>
<div class="line">| AES256-DOCSIS | Y(2) | <--- | <--- | Y(2) | <--- | <--- | <--- | Y(2) | Y(4) |</div>
<div class="line">| DES-DOCSIS | Y | <--- | <--- | <--- | <--- | <--- | <--- | Y x16 | <--- |</div>
<div class="line">| 3DES/TDES | Y | <--- | <--- | <--- | <--- | <--- | <--- | Y x16 | <--- |</div>
<div class="line">| DES | Y | <--- | <--- | <--- | <--- | <--- | <--- | Y x16 | <--- |</div>
<div class="line">| KASUMI-F8 | Y | <--- | <--- | <--- | <--- | <--- | <--- | <--- | <--- |</div>
<div class="line">| ZUC-EEA3 | Y x4 | <--- | Y(5)x4 | Y x8 | Y(5)x8 | <--- | <--- | Y x16 | Y(5) x16 |</div>
<div class="line">| ZUC-EEA3-256 | Y x4 | <--- | Y(5)x4 | Y x8 | Y(5)x8 | <--- | <--- | Y x16 | Y(5) x16 |</div>
<div class="line">| SNOW3G-UEA2 | Y x4 | <--- | <--- | <--- | <--- | <--- | <--- | Y x16 | Y x16 |</div>
<div class="line">| AES128-CBCS(1) | Y | <--- | <--- | Y(2) | <--- | <--- | <--- | <--- | Y(9) |</div>
<div class="line">| Chacha20 | Y | <--- | <--- | Y | <--- | <--- | <--- | Y | <--- |</div>
<div class="line">| Chacha20 AEAD | Y | <--- | <--- | Y | <--- | <--- | <--- | Y | <--- |</div>
<div class="line">| SNOW-V | Y | <--- | <--- | Y | <--- | <--- | <--- | <--- | <--- |</div>
<div class="line">| SNOW-V AEAD | Y | <--- | <--- | Y | <--- | <--- | <--- | <--- | <--- |</div>
<div class="line">| PON-CRC-BIP | Y by8 | <--- | <--- | Y by8 | <--- | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| SM4-ECB | Y | <--- | <--- | <--- | <--- | <--- | Y(6) | [S1] | [S1] |</div>
<div class="line">| SM4-CBC | Y | <--- | <--- | <--- | <--- | <--- | Y(7) | [S1] | [S1] |</div>
<div class="line">| SM4-CTR | Y | <--- | <--- | <--- | <--- | <--- | Y(8) | [S1] | [S1] |</div>
<div class="line">| SM4-GCM | Y | <--- | <--- | <--- | <--- | <--- | Y(8) | [S1] | [S1] |</div>
<div class="line">+---------------------------------------------------------------------------------------------------+</div>
</div><!-- fragment --><p> Notes: <br />
(1) - Currently 1:9 crypt:skip pattern supported. <br />
(2) - Decryption is by8 and encryption is x8. <br />
(3) - Single block decryption and encryption. <br />
(4) - Decryption is by16 and encryption is x16. <br />
(5) - Implementation using GFNI extensions. <br />
(6) - Implementation using SM4NI extensions, by16. <br />
(7) - Implementation using SM4NI extensions, single block encryption and by16 decryption. <br />
(8) - Implementation using SM4NI extensions, by8. <br />
(9) - Decryption is by16 and encryption is x12. <br />
</p>
<p>Legend: <br />
<code>byY</code>- single buffer Y blocks at a time <br />
<code>xY</code>- Y buffers at a time <br />
<code>[xyz]</code>- same as <code>xyz</code> implementation <br />
<code><---</code>- same as the column to the left <br />
</p>
<p>Table 2. List of supported integrity algorithms and their implementations. </p><div class="fragment"><div class="line">+-----------------------------------------------------------------------------------------------------+</div>
<div class="line">| | Implementation |</div>
<div class="line">| Integrity +---------------------------------------------------------------------------------|</div>
<div class="line">| | SSE | SSE | SSE | AVX2 | AVX2 | AVX2 | AVX2 | AVX512 | AVX512 |</div>
<div class="line">| | Type 1 | Type 2 | Type 3 | Type 1 | Type 2 | Type 3 | Type 4 | Type 1 | Type 2 |</div>
<div class="line">| | [S1] | [S2] | [S3] | [A2-1] | [A2-2] | [A2-3] | [A2-4] | [A3-1] | [A3-2] |</div>
<div class="line">|-------------------+--------+--------+--------+--------+--------+--------+--------+--------+---------|</div>
<div class="line">| AES-XCBC-96 | Y x4 | <--- | <--- | Y x8 | <--- | <--- | <--- | <--- | Y x16 |</div>
<div class="line">| HMAC-MD5-96 | Y(1)x4 | <--- | <--- | Y x8 | <--- | <--- | <--- | <--- | <--- |</div>
<div class="line">| HMAC-SHA1-96 | Y x4 | Y(2)x2 | <--- | Y x8 | Y(2)x2 | <--- | [A2-1] | Y x16 | <--- |</div>
<div class="line">| HMAC-SHA2-224_112 | Y x4 | Y(2)x2 | <--- | Y x8 | Y(2)x2 | <--- | <--- | Y x16 | <--- |</div>
<div class="line">| HMAC-SHA2-256_128 | Y x4 | Y(2)x2 | <--- | Y x8 | Y(2)x2 | <--- | <--- | Y x16 | <--- |</div>
<div class="line">| HMAC-SHA2-384_192 | Y x2 | <--- | <--- | Y x4 | <--- | <--- | Y(6)x2 | Y x8 | <--- |</div>
<div class="line">| HMAC-SHA2-512_256 | Y x2 | <--- | <--- | Y x4 | <--- | <--- | Y(6)x2 | Y x8 | <--- |</div>
<div class="line">| SHA1 | Y(2)x4 | Y(2)x2 | <--- | Y x8 | Y(2)x2 | <--- | [A2-1] | Y x16 | <--- |</div>
<div class="line">| SHA2-224 | Y(2)x4 | Y(2)x2 | <--- | Y x8 | Y(2)x2 | <--- | <--- | Y x16 | <--- |</div>
<div class="line">| SHA2-256 | Y(2)x4 | Y(2)x2 | <--- | Y x8 | Y(2)x2 | <--- | <--- | Y x16 | <--- |</div>
<div class="line">| SHA2-384 | Y x2 | <--- | <--- | Y x4 | <--- | <--- | Y(6)x2 | Y x8 | <--- |</div>
<div class="line">| SHA2-512 | Y x2 | <--- | <--- | Y x4 | <--- | <--- | Y(6)x2 | Y x8 | <--- |</div>
<div class="line">| AES128-GMAC | Y by8 | <--- | <--- | Y by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y by32 |</div>
<div class="line">| AES192-GMAC | Y by8 | <--- | <--- | Y by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y by32 |</div>
<div class="line">| AES256-GMAC | Y by8 | <--- | <--- | Y by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y by32 |</div>
<div class="line">| AES128-CCM | Y x8 | <--- | <--- | Y x8 | <--- | <--- | <--- | <--- | Y x16 |</div>
<div class="line">| AES256-CCM | Y x8 | <--- | <--- | Y x8 | <--- | <--- | <--- | <--- | Y x16 |</div>
<div class="line">| AES128-CMAC-96 | Y x8 | <--- | <--- | Y x8 | <--- | <--- | <--- | <--- | Y x16 |</div>
<div class="line">| AES256-CMAC-96 | Y x8 | <--- | <--- | Y x8 | <--- | <--- | <--- | <--- | Y x16 |</div>
<div class="line">| KASUMI-F9 | Y | <--- | <--- | <--- | <--- | <--- | <--- | <--- | <--- |</div>
<div class="line">| ZUC-EIA3 | Y x4 | <--- | Y(3)x4 | Y x8 | Y(3)x8 | <--- | <--- | Y x16 | Y(3)x16 |</div>
<div class="line">| ZUC-EIA3-256 | Y x4 | <--- | Y(3)x4 | Y x8 | Y(3)x8 | <--- | <--- | Y x16 | Y(3)x16 |</div>
<div class="line">| SNOW3G-UIA2 | Y(10) | <--- | <--- | Y(10) | <--- | <--- | <--- | <--- | Y(11) |</div>
<div class="line">| DOCSIS-CRC32(8) | Y | <--- | <--- | Y | <--- | <--- | <--- | <--- | Y |</div>
<div class="line">| HEC | Y | <--- | <--- | Y | <--- | <--- | <--- | <--- | <--- |</div>
<div class="line">| POLY1305 | Y | <--- | <--- | <--- | <--- | Y(4) | <--- | Y | Y(4) |</div>
<div class="line">| POLY1305 AEAD | Y | <--- | <--- | <--- | <--- | Y(4) | <--- | Y | Y(4) |</div>
<div class="line">| SNOW-V AEAD | Y by8 | <--- | <--- | Y by8 | <--- | <--- | <--- | <--- | Y by32 |</div>
<div class="line">| GHASH | Y by8 | <--- | <--- | Y by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y by32 |</div>
<div class="line">| CRC(7) | Y by8 | <--- | <--- | Y by8 | <--- | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| PON-CRC-BIP(9) | Y | <--- | <--- | Y | <--- | <--- | <--- | <--- | Y by16 |</div>
<div class="line">| SM3 | Y | <--- | <--- | <--- | <--- | <--- | Y(5)x2 | [S1] | <--- |</div>
<div class="line">| HMAC-SM3 | Y | <--- | <--- | <--- | <--- | <--- | Y(5)x2 | [S1] | <--- |</div>
<div class="line">| SM4-GCM | Y | <--- | <--- | Y by8 | Y by16 | [A2-1] | [A2-2] | [A2-1] | Y by32 |</div>
<div class="line">+-----------------------------------------------------------------------------------------------------+</div>
</div><!-- fragment --><p> Notes: <br />
(1) - MD5 over one block implemented in C. <br />
(2) - Implementation using SHANI extensions. <br />
(3) - Implementation using GFNI extensions. <br />
(4) - Implementation using IFMA extensions. <br />
(5) - Implementation using SM3NI extensions. <br />
(6) - Implementation using SHA512NI extensions. <br />
(7) - Supported CRC types: <br />
</p><ul>
<li>CRC32: Ethernet FCS, SCTP, WIMAX OFDMA <br />
</li>
<li>CRC24: LTE A, LTE B <br />
</li>
<li>CRC16: X25, FP data <br />
</li>
<li>CRC11: FP header <br />
</li>
<li>CRC10: IUUP data <br />
</li>
<li>CRC8: WIMAX OFDMA HCS <br />
</li>
<li>CRC7: FP header <br />
</li>
<li>CRC6: IUUP header <br />
</li>
</ul>
<p>(8) - used only with AES256-DOCSIS and AES128-DOCSIS ciphers. <br />
(9) - used only with PON-AES128-CTR cipher. <br />
(10) - x4 for init keystream generation, then by4. <br />
(11) - x16 for init keystream generation, then by32. <br />
</p>
<p>Legend: <br />
<code>byY</code>- single buffer Y blocks at a time <br />
<code>xY</code>- Y buffers at a time <br />
<code>[xyz]</code>- same as <code>xyz</code> implementation <br />
<code><---</code>- same as the column to the left <br />
</p>
<p>Table 3. Encryption and integrity algorithm combinations </p><div class="fragment"><div class="line">+-----------------------------------------------------------------------------+</div>
<div class="line">| Encryption Algorithm | Allowed Integrity Algorithms |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES128-GCM | AES128-GMAC |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES192-GCM | AES192-GMAC |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES256-GCM | AES256-GMAC |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES128-CCM | AES128-CCM |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES256-CCM | AES256-CCM |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| SM4-GCM | SM4-GCM |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES128-CBC, AES192-CBC, AES256-CBC, | AES-XCBC-96, AES128-CMAC-96, |</div>
<div class="line">| AES128-CTR, AES192-CTR, AES256-CTR, | HMAC-SHA1-96, HMAC-SHA2-224_112, |</div>
<div class="line">| AES128-ECB, AES192-ECB, AES256-ECB, | HMAC-SHA2-256_128, HMAC-SHA2-384_192, |</div>
<div class="line">| AES128-CFB, AES192-CFB, AES256-CFB, | HMAC-SHA2-512_256, NULL, POLY1305, |</div>
<div class="line">| NULL, Chacha20, | AES128-GMAC, AES192-GMAC, AES256-GMAC,|</div>
<div class="line">| AES128-DOCSIS, AES256-DOCSIS, | GHASH, SM3, HMAC-SM3 |</div>
<div class="line">| DES-DOCSIS, 3DES, DES, | ZUC-EIA3, ZUC-EIA3-256, SNOW3G-UIA3, |</div>
<div class="line">| KASUMI-F8, SNOW-V, SNOW3G-UEA3, | KASUMI-F9 |</div>
<div class="line">| ZUC-EEA3, ZUC-EEA3-256, | |</div>
<div class="line">| SM4-ECB, SM4-CBC, SM4-CTR | |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| AES128-DOCSIS, AES256-DOCSIS | DOCSIS-CRC32 |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| PON-AES128-CTR | PON-CRC-BIP |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| CHACHA20 AEAD | POLY1305 AEAD |</div>
<div class="line">|-------------------------------------+---------------------------------------|</div>
<div class="line">| SNOW-V AEAD | SNOW-V AEAD (GHASH) |</div>
<div class="line">+-------------------------------------+---------------------------------------+</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md3"></a>
2. Processor Extensions and Architecture Types</h2>
<p>Table 4. Processor extensions used in the library </p><div class="fragment"><div class="line">+---------------------------------------------------------------------------------------+</div>
<div class="line">| Architecture | Instruction Extensions | Example Products |</div>
<div class="line">| Type | | |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| SSE Type 1 | SSE4.2, AESNI, PCLMULQDQ, CMOV, BSWAP | Westmere, Sandy Bridge, |</div>
<div class="line">| | | Ivy Bridge, Rangeley, Avoton |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| SSE Type 2 | [SSE Type 1] + SHANI | Denverton |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| SSE Type 3 | [SSE Type 2] + GFNI | Snow Ridge |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX2 Type 1 | [SSE Type 1] + XSAVE, OSXSAVE, AVX, | Haswell, Broadwell |</div>
<div class="line">| | AVX2, BMI2 | |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX2 Type 2 | [AVX2 Type 1] + SHANI, GFNI, VAES, | Arizona Beach, Alder Lake |</div>
<div class="line">| | VPCLMULQDQ | Raptor Lake |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX2 Type 3 | [AVX2 Type 2] + AVX-IFMA | Sierra Forest |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX2 Type 4 | [AVX2 Type 3] + SM3NI, SM4NI, SHA512NI | Lunar Lake |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX512 Type 1 | [AVX2 Type 1] + AVX512F, AVX512DQ, | Sky Lake, Cascade Lake |</div>
<div class="line">| | AVX512CD, AVX512BW, AVX512VL | |</div>
<div class="line">|---------------+----------------------------------------+------------------------------|</div>
<div class="line">| AVX512 Type 2 | [AVX512 Type 1] + SHANI, GFNI, | Ice Lake, Sapphire Rapids, |</div>
<div class="line">| | AVX512-IFMA, VAES, VPCLMULQDQ | Emerald Rapids |</div>
<div class="line">+---------------------------------------------------------------------------------------+</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md4"></a>
3. Recommendations</h2>
<p>Legacy or to be avoided algorithms listed in the table below are implemented in the library in order to support legacy applications. Please use corresponding alternative algorithms instead. </p><div class="fragment"><div class="line">+--------------------------------------------------------------+</div>
<div class="line">| # | Algorithm | Recommendation | Alternative |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 1 | DES encryption | Avoid | AES encryption |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 2 | 3DES encryption | Avoid | AES encryption |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 3 | HMAC-MD5 integrity | Legacy | HMAC-SHA256 |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 4 | AES-ECB encryption | Avoid | AES-CBC, AES-CNTR |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 3 | HMAC-SHA1 integrity | Avoid | HMAC-SHA256 |</div>
<div class="line">+--------------------------------------------------------------+</div>
</div><!-- fragment --><p> Intel(R) Multi-Buffer Crypto for IPsec Library depends on C library and it is recommended to use its latest version.</p>
<p>Applications using the Intel(R) Multi-Buffer Crypto for IPsec Library rely on Operating System to provide process isolation. As the result, it is recommended to use latest Operating System patches and security updates.</p>
<h2><a class="anchor" id="autotoc_md5"></a>
4. Package Content</h2>
<ul>
<li>test - Library test applications</li>
<li>perf - Library performance application</li>
<li>lib - Library source files</li>
<li>lib/x86_64 - Non-SIMD routines</li>
<li>lib/sse_* - Intel(R) SSE optimized routines</li>
<li>lib/avx2_* - Intel(R) AVX2 optimized routines</li>
<li>lib/avx512_* - Intel(R) AVX512 optimized routines</li>
</ul>
<p><b>Note:</b> <br />
There is just one branch used in the project. All development is done on the main branch. <br />
Code taken from the tip of the main branch should not be considered fit for production. <br />
</p>
<p>Refer to the releases tab for stable code versions: <br />
<a href="https://github.com/intel/intel-ipsec-mb/releases">https://github.com/intel/intel-ipsec-mb/releases</a></p>
<h2><a class="anchor" id="autotoc_md6"></a>
5. Documentation</h2>
<p>Full documentation can be found at: <a href="https://intel.github.io/intel-ipsec-mb">https://intel.github.io/intel-ipsec-mb</a></p>
<p>To generate documentation locally, run: <br />
<code>> make doxy</code></p>
<h2><a class="anchor" id="autotoc_md7"></a>
6. Compilation</h2>
<p>Refer to the compilation section of the <a href="https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#compilation">INSTALL</a> file for instructions.</p>
<h2><a class="anchor" id="autotoc_md8"></a>
7. Installation</h2>
<p>Refer to the installation section of the <a href="https://github.com/intel/intel-ipsec-mb/blob/main/INSTALL.md#installation">INSTALL</a> file for instructions.</p>
<h2><a class="anchor" id="autotoc_md9"></a>
8. Security Considerations & Options for Increased Security</h2>
<p>Refer to the <a href="https://github.com/intel/intel-ipsec-mb/blob/main/SECURITY.md#security-considerations--options-for-increased-security">SECURITY</a> file for security related information.</p>
<h2><a class="anchor" id="autotoc_md10"></a>
9. Backwards compatibility</h2>
<p>In version 1.4, backward compile time symbol compatibility with library version 0.53 has been removed.</p>
<p>Applications are encouraged to use new symbol names introduced in version 0.54.</p>
<p>If required, compatibility symbol mapping can be implemented in the application. See compatibility symbol mapping in v1.3 header file: <a href="https://github.com/intel/intel-ipsec-mb/blob/v1.3/lib/intel-ipsec-mb.h#L246">https://github.com/intel/intel-ipsec-mb/blob/v1.3/lib/intel-ipsec-mb.h#L246</a></p>
<h2><a class="anchor" id="autotoc_md11"></a>
10. Disclaimer (ZUC, KASUMI, SNOW3G)</h2>
<p>Please note that cryptographic material, such as ciphering algorithms, may be subject to national regulations. What is more, use of some algorithms in real networks and production equipment can be subject to agreement or licensing by the GSMA and/or the ETSI.</p>
<p>For more details please see: <br />
</p><ul>
<li>GSMA <a href="https://www.gsma.com/security/security-algorithms/">https://www.gsma.com/security/security-algorithms/</a> <br />
</li>
<li>ETSI <a href="https://www.etsi.org/security-algorithms-and-codes/cellular-algorithm-licences">https://www.etsi.org/security-algorithms-and-codes/cellular-algorithm-licences</a></li>
</ul>
<h2><a class="anchor" id="autotoc_md12"></a>
11. Legal Disclaimer</h2>
<p>THIS SOFTWARE IS PROVIDED BY INTEL"AS IS". NO LICENSE, EXPRESS OR <br />
IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS <br />
ARE GRANTED THROUGH USE. EXCEPT AS PROVIDED IN INTEL'S TERMS AND <br />
CONDITIONS OF SALE, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL <br />
DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR <br />
USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO <br />
FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT <br />
OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. <br />
</p>
<h2><a class="anchor" id="autotoc_md13"></a>
12. FIPS Compliance</h2>
<p>The library does not fulfill technical requirements to achieve Cryptographic Module (CMVP) certification as a standalone component. It is fit for Cryptographic Algorithm validation and certification (CAVP) and it can be part of CMVP as one of the components.</p>
<h3><a class="anchor" id="autotoc_md14"></a>
CAVP</h3>
<p>ACVP test application located in <code>test</code> directory is to support CAVP process. It implements validation of the following algorithms: <br />
</p><ul>
<li>AES-GCM <br />
</li>
<li>AES-GMAC <br />
</li>
<li>AES-CCM <br />
</li>
<li>AES-CBC <br />
</li>
<li>AES-EBC</li>
<li>AES-CFB</li>
<li>TDES-EDE-CBC <br />
</li>
<li>AES-CTR <br />
</li>
<li>AES-CMAC <br />
</li>
<li>SHA1 (SHA-1) <br />
</li>
<li>SHA224 (SHA2-224) <br />
</li>
<li>SHA256 (SHA2-256) <br />
</li>
<li>SHA384 (SHA2-384) <br />
</li>
<li>SHA512 (SHA2-512) <br />
</li>
<li>HMAC-SHA1 (HMAC-SHA-1) <br />
</li>
<li>HMAC-SHA224 (HMAC-SHA2-224) <br />
</li>
<li>HMAC-SHA256 (HMAC-SHA2-256) <br />
</li>
<li>HMAC-SHA384 (HMAC-SHA2-384) <br />
</li>
<li>HMAC-SHA512 (HMAC-SHA2-512) <br />
</li>
</ul>
<p>Note: the acvp-app requires libacvp 2.0+ to be built.</p>
<h3><a class="anchor" id="autotoc_md15"></a>
CAVP Algorithm Parameters</h3>
<p><b>Note:</b> all sizes in bits </p><div class="fragment"><div class="line">+--------------------------------------------------------------------------------------------+</div>
<div class="line">| Algorithm | Standard | Parameters |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-GCM | SP800-38D | Key size: 128, 192, 256 |</div>
<div class="line">| | | Direction: encrypt and decrypt |</div>
<div class="line">| | | ivLen: [min = 8, max = 1024, increment 8] |</div>
<div class="line">| | | tagLen: 32, 64, 96, 104, 112, 120, 128 |</div>
<div class="line">| | | payloadLen: [min = 0, max = 65536, increment = 8] |</div>
<div class="line">| | | aadLen: [min = 0, max = 65536, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CBC | SP800-38A | Key size: 128, 192, 256 |</div>
<div class="line">| | | Direction: encrypt and decrypt |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CTR | SP800-38A | Key size: 128, 192, 256 |</div>
<div class="line">| | | Direction: encrypt and decrypt |</div>
<div class="line">| | | payloadLen: [min = 8, max = 128, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-ECB | SP800-38A | Key size: 128, 192, 256 |</div>
<div class="line">| | | Direction: encrypt and decrypt |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CFB128 | SP800-38A | Key size: 128, 192, 256 |</div>
<div class="line">| | | Direction: encrypt and decrypt |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| TDES-EDE-CBC | SP800-38A | Key size: 192 |</div>
<div class="line">| | | Direction: encrypt and decrypt |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA1 (SHA-1) | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA224 (SHA2-224) | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA256 (SHA2-256) | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA384 (SHA2-384) | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA512 (SHA2-512) | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CCM | SP800-38C | Key size: 128, 256 |</div>
<div class="line">| | | Direction: encrypt and decrypt |</div>
<div class="line">| | | ivLen: [min = 56, max = 104, increment 8] |</div>
<div class="line">| | | tagLen: 32, 48, 64, 80, 96, 112, 128 |</div>
<div class="line">| | | payloadLen: [min = 0, max = 256, increment = 8] |</div>
<div class="line">| | | aadLen: [min = 0, max = 368, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-GMAC | SP800-38B | Key size: 128, 192, 256 |</div>
<div class="line">| | | ivLen: [min = 8, max = 1024, increment 8] |</div>
<div class="line">| | | tagLen: 32, 64, 96, 104, 112, 120, 128 |</div>
<div class="line">| | | aadLen: [min = 0, max = 65536, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CMAC | SP800-38B | Key size: 128, 256 |</div>
<div class="line">| | | msgLen: [min = 8, max = 65528, increment 8] |</div>
<div class="line">| | | macLen: [min = 8, max = 128, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA1 | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8] |</div>
<div class="line">| (HMAC-SHA-1) | | macLen: [min = 32, max = 160, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA224 | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8] |</div>
<div class="line">| (HMAC-SHA2-224) | | macLen: [min = 32, max = 224, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA256 | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8] |</div>
<div class="line">| (HMAC-SHA2-256) | | macLen: [min = 32, max = 256, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA384 | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8] |</div>
<div class="line">| (HMAC-SHA2-384) | | macLen: [min = 32, max = 384, increment = 8] |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA512 | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8] |</div>
<div class="line">| (HMAC-SHA2-512) | | macLen: [min = 32, max = 512, increment = 8] |</div>
<div class="line">+--------------------------------------------------------------------------------------------+</div>
</div><!-- fragment --> <h3><a class="anchor" id="autotoc_md16"></a>
Self-Test</h3>
<p>In order to support CMVP, the library implements Self-Test functionality that is available with all compilation options. The test is always performed as part of library initialization (power-up). There is no conditional self-test functionality as none of such conditions occur (i.e. pair-wise consistency test, software/firmware load test, manual key entry test, continuous random number generator test, and bypass test).</p>
<p>Application can register self-test callback function to track test progress. Optionally application can corrupt input message for selected tests and observe change in the test result.</p>
<p>Example sequence of callbacks received by an application is:</p><ul>
<li>callback(data.phase = IMB_SELF_TEST_PHASE_START, data.type = IMB_SELF_TEST_TYPE_KAT_CIPHER, data.descr = "AES128-CBC") => return 1</li>
<li>callback(data.phase = IMB_SELF_TEST_PHASE_CORRUPT)<ul>
<li>return 1: no message corruption</li>
<li>return 0: corrupt single bit in the 1st byte</li>
</ul>
</li>
<li>callback(data.phase = IMB_SELF_TEST_PHASE_PASS or IMB_SELF_TEST_PHASE_PASS) => return 1</li>
<li>callback(data.phase = IMB_SELF_TEST_PHASE_START, data.type = IMB_SELF_TEST_TYPE_KAT_CIPHER, data.descr = "AES192-CBC") => return 1</li>
<li>... Note that value returned by application self-test callback function only matters in the corrupt phase.</li>
</ul>
<p>The self-test consists of Cryptographic algorithm test (known answer test) on following types and algorithms: <br />
</p><ul>
<li>KAT_AEAD:<ul>
<li>AES-GCM <br />
</li>
<li>AES-CCM <br />
</li>
</ul>
</li>
<li>KAT_Cipher:<ul>
<li>AES-CBC <br />
</li>
<li>AES-CTR <br />
</li>
<li>AES-ECB <br />
</li>
<li>AES-CFB</li>
<li>TDES-EDE-CBC <br />
</li>
</ul>
</li>
<li>KAT_Auth:<ul>
<li>AES-GMAC <br />
</li>
<li>AES-CMAC <br />
</li>
<li>SHA1 <br />
</li>
<li>SHA224 <br />
</li>
<li>SHA256 <br />
</li>
<li>SHA384 <br />
</li>
<li>SHA512 <br />
</li>
<li>HMAC-SHA1 <br />
</li>
<li>HMAC-SHA224 <br />
</li>
<li>HMAC-SHA256 <br />
</li>
<li>HMAC-SHA384 <br />
</li>
<li>HMAC-SHA512 <br />
</li>
</ul>
</li>
</ul>
<p>KAT_Cipher and KAT_AEAD types conduct tests in encrypt and decrypt cipher directions. However, the corrupt callback is made only for the encrypt direction. No callback is made for the decrypt direction at the moment.</p>
<p>Example detection of library self-test completion & error in the application: </p><div class="fragment"><div class="line">IMB_ARCH arch;</div>
<div class="line">IMB_MGR *p_mgr = alloc_mb_mgr(0);</div>
<div class="line"> </div>
<div class="line">init_mb_mgr_auto(p_mgr, &arch); /* or init_mb_mgr_sse/avx/avx2/avx512 */</div>
<div class="line"> </div>
<div class="line">/*</div>
<div class="line"> * check for self-test presence and successful</div>
<div class="line"> * - requires library version v1.3 or newer</div>
<div class="line"> */</div>
<div class="line">if (p_mgr->features & IMB_FEATURE_SELF_TEST) {</div>
<div class="line"> /* self-test feature present */</div>
<div class="line"> if (p_mgr->features & IMB_FEATURE_SELF_TEST_PASS) {</div>
<div class="line"> printf("SELF-TEST: PASS\n");</div>
<div class="line"> } else {</div>
<div class="line"> printf("SELF-TEST: FAIL\n");</div>
<div class="line"> }</div>
<div class="line">} else {</div>
<div class="line"> printf("SELF-TEST: N/A (requires library >= v1.3)\n");</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line">/* check for initialization self-test error */</div>
<div class="line">if (imb_get_errno(p_mgr) == IMB_ERR_SELFTEST) {</div>
<div class="line"> /* self-test error */</div>
<div class="line"> exit(EXIT_FAILURE);</div>
<div class="line">}</div>
</div><!-- fragment --><p>Example registration of self-test callback function: </p><div class="fragment"><div class="line">int self_test_corrupt = 0;</div>
<div class="line"> </div>
<div class="line">int callback(void *arg, const IMB_SELF_TEST_CALLBACK_DATA *data)</div>
<div class="line">{</div>
<div class="line"> const char *phase = "";</div>
<div class="line"> const char *type = "";</div>
<div class="line"> const char *descr = "";</div>
<div class="line"> </div>
<div class="line"> (void) arg;</div>
<div class="line"> </div>
<div class="line"> if (data != NULL) {</div>
<div class="line"> if (data->phase != NULL)</div>
<div class="line"> phase = data->phase;</div>
<div class="line"> if (data->type != NULL)</div>
<div class="line"> type = data->type;</div>
<div class="line"> if (data->descr != NULL)</div>
<div class="line"> descr = data->descr;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> if (strcmp(phase, IMB_SELF_TEST_PHASE_START) == 0)</div>
<div class="line"> printf("%s : %s : ", type, descr);</div>
<div class="line"> </div>
<div class="line"> if ((strcmp(phase, IMB_SELF_TEST_PHASE_CORRUPT) == 0) && (self_test_corrupt == 1))</div>
<div class="line"> return 0; /* corrupt input message */</div>
<div class="line"> </div>
<div class="line"> if (strcmp(phase, IMB_SELF_TEST_PHASE_PASS) == 0 ||</div>
<div class="line"> strcmp(phase, IMB_SELF_TEST_PHASE_FAIL) == 0)</div>
<div class="line"> printf("%s\n", phase);</div>
<div class="line"> </div>
<div class="line"> return 1;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line">...</div>
<div class="line"> </div>
<div class="line">IMB_ARCH arch;</div>
<div class="line">IMB_MGR *p_mgr = alloc_mb_mgr(0);</div>
<div class="line"> </div>
<div class="line">/*</div>
<div class="line"> * Register self-test callback that will be invoked during</div>
<div class="line"> * subsequent init operation</div>
<div class="line"> */</div>
<div class="line">imb_self_test_set_cb(p_mgr, callback, NULL);</div>
<div class="line"> </div>
<div class="line">init_mb_mgr_auto(p_mgr, &arch); /* or init_mb_mgr_sse/avx/avx2/avx512 */</div>
<div class="line"> </div>
<div class="line">...</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md17"></a>
13.DLL Injection Attack</h2>
<h3><a class="anchor" id="autotoc_md18"></a>
Problem</h3>
<p>The Windows OS has an insecure predefined search order and set of defaults when trying to locate a resource. If the resource location is not specified by the software, an attacker need only place a malicious version in one of the locations Windows will search, and it will be loaded instead. Although this weakness can occur with any resource, it is especially common with DLL files.</p>
<h3><a class="anchor" id="autotoc_md19"></a>
Solutions</h3>
<p>Applications using intel-ipsec-mb DLL library may need to apply one of the solutions to prevent from DLL injection attack.</p>
<p>Two solutions are available:</p><ul>
<li>Using a Fully Qualified Path is the most secure way to load a DLL <br />
</li>
<li>Signature verification of the DLL <br />
</li>
</ul>
<h3><a class="anchor" id="autotoc_md20"></a>
Resources and Solution Details</h3>
<ul>
<li>Security remarks section of LoadLibraryEx documentation by Microsoft: <a href="https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa#security-remarks">https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa#security-remarks</a> <br />
</li>
<li>Microsoft Dynamic Link Library Security article: <a href="https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security">https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security</a> <br />
</li>
<li>Hijack Execution Flow: DLL Search Order Hijacking: <a href="https://attack.mitre.org/techniques/T1574/001">https://attack.mitre.org/techniques/T1574/001</a> <br />
</li>
<li>Hijack Execution Flow: DLL Side-Loading: <a href="https://attack.mitre.org/techniques/T1574/002">https://attack.mitre.org/techniques/T1574/002</a> <br />
</li>
</ul>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
</ul>
</div>
</body>
</html>
|