xref: /dpdk/doc/guides/cryptodevs/openssl.rst (revision 945acb4a0d644d194f1823084a234f9c286dcf8c)
1..  BSD LICENSE
2    Copyright(c) 2016 Intel Corporation. All rights reserved.
3
4    Redistribution and use in source and binary forms, with or without
5    modification, are permitted provided that the following conditions
6    are met:
7
8    * Redistributions of source code must retain the above copyright
9    notice, this list of conditions and the following disclaimer.
10    * Redistributions in binary form must reproduce the above copyright
11    notice, this list of conditions and the following disclaimer in
12    the documentation and/or other materials provided with the
13    distribution.
14    * Neither the name of Intel Corporation nor the names of its
15    contributors may be used to endorse or promote products derived
16    from this software without specific prior written permission.
17
18    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30OpenSSL Crypto Poll Mode Driver
31===============================
32
33This code provides the initial implementation of the openssl poll mode
34driver. All cryptography operations are using Openssl library crypto API.
35Each algorithm uses EVP interface from openssl API - which is recommended
36by Openssl maintainers.
37
38For more details about openssl library please visit openssl webpage:
39https://www.openssl.org/
40
41Features
42--------
43
44OpenSSL PMD has support for:
45
46Supported cipher algorithms:
47
48* ``RTE_CRYPTO_CIPHER_3DES_CBC``
49* ``RTE_CRYPTO_CIPHER_AES_CBC``
50* ``RTE_CRYPTO_CIPHER_AES_CTR``
51* ``RTE_CRYPTO_CIPHER_3DES_CTR``
52* ``RTE_CRYPTO_CIPHER_DES_DOCSISBPI``
53
54Supported authentication algorithms:
55
56* ``RTE_CRYPTO_AUTH_AES_GMAC``
57* ``RTE_CRYPTO_AUTH_MD5``
58* ``RTE_CRYPTO_AUTH_SHA1``
59* ``RTE_CRYPTO_AUTH_SHA224``
60* ``RTE_CRYPTO_AUTH_SHA256``
61* ``RTE_CRYPTO_AUTH_SHA384``
62* ``RTE_CRYPTO_AUTH_SHA512``
63* ``RTE_CRYPTO_AUTH_MD5_HMAC``
64* ``RTE_CRYPTO_AUTH_SHA1_HMAC``
65* ``RTE_CRYPTO_AUTH_SHA224_HMAC``
66* ``RTE_CRYPTO_AUTH_SHA256_HMAC``
67* ``RTE_CRYPTO_AUTH_SHA384_HMAC``
68* ``RTE_CRYPTO_AUTH_SHA512_HMAC``
69
70Supported AEAD algorithms:
71
72* ``RTE_CRYPTO_AEAD_AES_GCM``
73* ``RTE_CRYPTO_AEAD_AES_CCM``
74
75
76Installation
77------------
78
79To compile openssl PMD, it has to be enabled in the config/common_base file
80and appropriate openssl packages have to be installed in the build environment.
81
82The newest openssl library version is supported:
83
84* 1.0.2h-fips  3 May 2016.
85
86Older versions that were also verified:
87
88* 1.0.1f 6 Jan 2014
89* 1.0.1 14 Mar 2012
90
91For Ubuntu 14.04 LTS these packages have to be installed in the build system:
92
93.. code-block:: console
94
95    sudo apt-get install openssl
96    sudo apt-get install libc6-dev-i386 # for i686-native-linuxapp-gcc target
97
98This code was also verified on Fedora 24.
99This code has NOT been verified on FreeBSD yet.
100
101Initialization
102--------------
103
104User can use app/test application to check how to use this pmd and to verify
105crypto processing.
106
107Test name is cryptodev_openssl_autotest.
108For performance test cryptodev_openssl_perftest can be used.
109
110To verify real traffic l2fwd-crypto example can be used with this command:
111
112.. code-block:: console
113
114	sudo ./build/l2fwd-crypto -l 0-1 -n 4 --vdev "crypto_openssl"
115	--vdev "crypto_openssl"-- -p 0x3 --chain CIPHER_HASH
116	--cipher_op ENCRYPT --cipher_algo AES_CBC
117	--cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f
118	--iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff
119	--auth_op GENERATE --auth_algo SHA1_HMAC
120	--auth_key 11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11
121	:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11
122	:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11
123
124Limitations
125-----------
126
127* Maximum number of sessions is 2048.
128* Chained mbufs are supported only for source mbuf (destination must be
129  contiguous).
130* Hash only is not supported for GCM and GMAC.
131* Cipher only is not supported for GCM and GMAC.
132