Intel(R) Multi-Buffer Crypto for IPSec
Clone or download
mdcornu Updated spec file for release v0.51
Change-Id: I9efe2d6424ffc413a9bc35c0847138f312a02b34
Latest commit 238733e Sep 13, 2018
Permalink
Failed to load latest commit information.
LibPerfApp Smoke test option added Aug 13, 2018
LibTestApp Added CFB validation to aes_test.c Aug 31, 2018
avx AVX HMAC-MD5 and HMAC-SHA submit job store to load optimization Sep 4, 2018
avx2 AVX2 HMAC-MD5 submit job store to load optimization Sep 11, 2018
avx512 Added new mb_mgr member and corresponding macro for AES128 CFB Aug 29, 2018
include AVX2 HMAC-MD5 submit job store to load optimization Sep 11, 2018
sse Merge "AES-CMAC SSE and AVX submit job store to load optimization upd… Aug 30, 2018
.gitignore This test tool performs multiple execution of functions from Intel Mar 9, 2017
LICENSE Year update in copyrights Feb 21, 2018
Makefile Added optimized AES CMAC AVX submit and flush jobs. Aug 10, 2018
README Added note in README to advise building without debugging information Mar 15, 2018
ReleaseNotes.txt Updated release notes for release v0.51 Sep 12, 2018
aes128_ecbenc_x3.asm Fix for issue #18 to disable stack execution flag in ELF shared libra… Mar 5, 2018
aes_cmac_subkey_gen.asm For binary compatibility replaced defines from the API with symbols May 31, 2018
aes_keyexp_128.asm For binary compatibility replaced defines from the API with symbols May 31, 2018
aes_keyexp_192.asm For binary compatibility replaced defines from the API with symbols May 31, 2018
aes_keyexp_256.asm For binary compatibility replaced defines from the API with symbols May 31, 2018
aes_xcbc_expand_key.c For binary compatibility replaced defines from the API with symbols May 31, 2018
alloc.c Library API consolidated into one header file Mar 8, 2018
asm.h AES128-CFB on single block added to the API Mar 9, 2018
const.asm AES-CMAC SSE and AVX submit job store to load optimization update. Aug 30, 2018
constants.asm Year update in copyrights Feb 21, 2018
constants.h Library API consolidated into one header file Mar 8, 2018
des.h Library API consolidated into one header file Mar 8, 2018
des_basic.c Library API consolidated into one header file Mar 8, 2018
des_key.c Library API consolidated into one header file Mar 8, 2018
gcm_defines.asm Year update in copyrights Feb 21, 2018
intel-ipsec-mb.h Updated library version for release v0.51 Sep 12, 2018
intel-ipsec-mb.spec Updated spec file for release v0.51 Sep 13, 2018
job_aes_hmac.asm Added optimized AES CMAC SSE submit job. Aug 3, 2018
libIPSec_MB.def Added optimized AES CMAC SSE submit job. Aug 3, 2018
libipsec-mb-dev.7 MAN page added and minor clarification added to README. Mar 2, 2018
libipsec-mb.7 MAN page added and minor clarification added to README. Mar 2, 2018
mb_mgr_code.h Removed AES CMAC submit and flush C code. Aug 10, 2018
mb_mgr_datastruct.asm Added optimized AES CMAC SSE submit job. Aug 3, 2018
md5_one_block.c For binary compatibility replaced defines from the API with symbols May 31, 2018
sha_one_block.c Local digest pointer setup correction Aug 23, 2018
version.c Added compile time and runtime library version checking. Jun 13, 2018
win_x64.mak Added optimized AES CMAC AVX submit and flush jobs. Aug 10, 2018

README

========================================================================
README for Intel(R) Multi-Buffer Crypto for IPsec Library

March 2018
========================================================================


Contents
========

- Overview
- Processor Extensions
- Recommendations
- Package Content
- Compilation
- Installation
- Legal Disclaimer


Overview
========
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.

For information on how to build and use this library, see the
Intel White Paper:
"Fast Multi-buffer IPsec Implementations on Intel Architecture Processors".
Jim Guilford, Sean Gulley, et. al.

The easiest way to find it is to search the Internet for the title and
Intel White Paper.

Table 1. List of supported cipher algorithms and their implementations.
+------------------------------------------------------------+
|               |              Implementation                |
| Encryption    +--------------------------------------------|
|               | x86_64 | SSE    | AVX    | AVX2   | AVX512 |
|---------------+--------+--------+--------+--------+--------|
| AES128-GCM    | N      | Y  by8 | Y  by8 | Y  by8 | N      |
| AES192-GCM    | N      | Y  by8 | Y  by8 | Y  by8 | N      |
| AES256-GCM    | N      | Y  by8 | Y  by8 | Y  by8 | N      |
| AES128-CCM    | Y(1)   | Y  by4 | Y  by8 | N      | N      |
| AES128-CBC    | N      | Y(2)   | Y(4)   | N      | N      |
| AES192-CBC    | N      | Y(2)   | Y(4)   | N      | N      |
| AES256-CBC    | N      | Y(2)   | Y(4)   | N      | N      |
| AES128-CTR    | N      | Y  by4 | Y  by8 | N      | N      |
| AES192-CTR    | N      | Y  by4 | Y  by8 | N      | N      |
| AES256-CTR    | N      | Y  by4 | Y  by8 | N      | N      |
| NULL          | Y      | N      | N      | N      | N      |
| AES128-DOCSIS | N      | Y(3)   | Y(5)   | N      | N      |
| DES-DOCSIS    | Y      | N      | N      | N      | Y  x16 |
| 3DES          | Y      | N      | N      | N      | Y  x16 |
| DES           | Y      | N      | N      | N      | Y  x16 |
+------------------------------------------------------------+

Notes:
(1)   - AES128-CCM scheduler code is implemented in C at the moment.
        Underlaying AES128-CTR algorithm utlizes SSE and AVX.
(2,3) - decryption is by4 and encryption is x4
(4,5) - decryption is by8 and encryption is x8

Legend:
  byY - single buffer Y blocks at a time
   xY - Y buffers at a time

As an example of how to read table 1 and 2, if one uses AVX512 interface
to perform AES128-CBC encryption then there is no native AVX512
implementation for this cipher. In such case, the library uses best
available implementation which is AVX for AES128-CBC.


Table 2. List of supported integrity algorithms and their implementations.
+----------------------------------------------------------------+
|                   |              Implementation                |
| Integrity         +--------------------------------------------|
|                   | x86_64 | SSE    | AVX    | AVX2   | AVX512 |
|-------------------+--------+--------+--------+--------+--------|
| AES-XCBC-96       | N      | Y   x4 | Y   x8 | N      | N      |
| HMAC-MD5-96       | Y(1)   | Y x4x2 | Y x4x2 | Y x8x2 | N      |
| HMAC-SHA1-96      | N      | Y(4)x4 | Y   x4 | Y   x8 | Y  x16 |
| HMAC-SHA2-224_112 | N      | Y(4)x4 | Y   x4 | Y   x8 | Y  x16 |
| HMAC-SHA2-256_128 | N      | Y(4)x4 | Y   x4 | Y   x8 | Y  x16 |
| HMAC-SHA2-384_192 | N      | Y   x2 | Y   x2 | Y   x4 | Y   x8 |
| HMAC-SHA2-512_256 | N      | Y   x2 | Y   x2 | Y   x4 | Y   x8 |
| AES128-GMAC       | N      | Y  by8 | Y  by8 | Y  by8 | N      |
| AES192-GMAC       | N      | Y  by8 | Y  by8 | Y  by8 | N      |
| AES256-GMAC       | N      | Y  by8 | Y  by8 | Y  by8 | N      |
| NULL              | N      | N      | N      | N      | N      |
| AES128-CCM        | Y(2)   | Y   x4 | Y   x8 | N      | N      |
| AES128-CMAC-96    | Y(3)   | Y   x4 | Y   x8 | N      | N      |
+----------------------------------------------------------------+

Notes:
(1)   - MD5 over one block implemented in C
(2,3) - AES128-CCM and AES128-CMAC scheduler code is implemented in C.
        Underlaying AES128-CBC algorithm utlizes SSE and AVX.
(4)   - Implementation using SHANI extentions is x2

Legend:
  byY - single buffer Y blocks at a time
   xY - Y buffers at a time

Table 3. Encryption and integrity algorithm combinations
+---------------------------------------------------------------------+
| Encryption    | Allowed Integrity Algorithms                        |
|---------------+-----------------------------------------------------|
| AES128-GCM    | AES128-GMAC                                         |
|---------------+-----------------------------------------------------|
| AES192-GCM    | AES192-GMAC                                         |
|---------------+-----------------------------------------------------|
| AES256-GCM    | AES256-GMAC                                         |
|---------------+-----------------------------------------------------|
| AES128-CCM    | AES128-CCM                                          |
|---------------+-----------------------------------------------------|
| AES128-CBC,   | AES-XCBC-96,                                        |
| AES192-CBC,   | HMAC-SHA1-96, HMAC-SHA2-224_112, HMAC-SHA2-256_128, |
| AES256-CBC,   | HMAC-SHA2-384_192, HMAC-SHA2-512_256,               |
| AES128-CTR,   | AES128-CMAC-96,                                     |
| AES192-CTR,   | NULL                                                |
| AES256-CTR,   |                                                     |
| NULL,         |                                                     |
| AES128-DOCSIS,|                                                     |
| DES-DOCSIS,   |                                                     |
| 3DES,         |                                                     |
| DES,          |                                                     |
+---------------+-----------------------------------------------------+


Processor Extensions
====================

Table 4. Processor extensions used in the library
+-------------------------------------------------------------------------+
| Algorithm         | Interface | Extensions                              |
|-------------------+-----------+-----------------------------------------|
| HMAC-SHA1-96,     | AVX512    | AVX512F, AVX512BW, AVX512VL             |
| HMAC-SHA2-224_112,|           |                                         |
| HMAC-SHA2-256_128,|           |                                         |
| HMAC-SHA2-384_192,|           |                                         |
| HMAC-SHA2-512_256 |           |                                         |
|-------------------+-----------+-----------------------------------------|
| DES, 3DES,        | AVX512    | AVX512F, AVX512BW                       |
| DOCSIS-DES        |           |                                         |
|-------------------+-----------+-----------------------------------------|
| HMAC-SHA1-96,     | SSE       | SHANI                                   |
| HMAC-SHA2-224_112,|           | - presence is autodetected and library  |
| HMAC-SHA2-256_128,|           |   falls back to SSE implementation      |
| HMAC-SHA2-384_192,|           |   if not present                        |
| HMAC-SHA2-512_256 |           |                                         |
|-------------------+-----------+-----------------------------------------|


Recommendations
===============

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.

+----------------------------------------------------------+
| # | Algorithm          | Recommendation | Alternative    |
|---+--------------------+----------------+----------------|
| 1 | DES encryption     | Avoid          | AES encryption |
|---+--------------------+----------------+----------------|
| 2 | 3DES encryption    | Avoid          | AES encryption |
|---+--------------------+----------------+----------------|
| 3 | HMAC-MD5 integrity | Legacy         | HMAC-SHA1      |
+----------------------------------------------------------+


Package Content
===============

LibTestApp - sample application using the library interface
sse - Intel(R) SSE optimized routines
avx - Intel(R) AVX optimized routines
avx2 - Intel(R) AVX2 optimized routines
avx512 - Intel(R) AVX512 optimized routines

Compilation
===========

Linux (64-bit only)
-------------------

Required tools:
- GNU make
- NASM version 2.12.02 (or newer)
- gcc (GCC) 4.8.3 (or newer)

Shared library:
> make

Static library:
> make SHARED=n

Clean the build:
> make clean
or
> make clean SHARED=n

Build with debugging information:
> make DEBUG=y

Note: Building with debugging information is not advised for production use.

Windows (x64 only)
------------------

Required tools:
- Microsoft (R) Visual Studio 2010:
  - NMAKE: Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
  - CL: Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
  - LIB: Microsoft (R) Library Manager Version 10.00.30319.01
  - LINK: Microsoft (R) Incremental Linker Version 10.00.30319.01
- NASM version 2.12.02 (or newer)

Shared library (DLL):
> nmake /f win_x64.mak

Static library:
> nmake /f win_x64.mak SHARED=n

Clean the build:
> nmake /f win_x64.mak clean
or
> nmake /f win_x64.mak clean SHARED=n

Build with debugging information:
> nmake /f win_x64.mak DEBUG=y

Note: Building with debugging information is not advised for production use.

Installation
============

Linux (64-bit only)
-------------------

First compile the library and then install:
> make
> sudo make install

To uninstall the library run:
> sudo make uninstall

If you want to change install location then define PREFIX
> sudo make install PREFIX=<path>

If there is no need to run ldconfig at install stage please use NOLDCONFIG=y option.
> sudo make install NOLDCONFIG=y

If library was compiled as an archive (not a default option) then install it
using SHARED=n option:
> sudo make install SHARED=n

Windows (x64 only)
------------------

First compile the library and then install from a command prompt in
administrator mode:
> nmake /f win_x64.mak
> nmake /f win_x64.mak install

To uninstall the library run:
> nmake /f win_x64.mak uninstall

If you want to change install location then define PREFIX (default C:\Program Files)
> nmake /f win_x64.mak install PREFIX=<path>

If library was compiled as a static library (not a default option) then install it
using SHARED=n option:
> nmake /f win_x64.mak install SHARED=n

Legal Disclaimer
================

THIS SOFTWARE IS PROVIDED BY INTEL"AS IS". NO LICENSE, EXPRESS OR
IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS
ARE GRANTED THROUGH USE. EXCEPT AS PROVIDED IN INTEL'S TERMS AND
CONDITIONS OF SALE, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL
DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR
USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO
FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT
OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.