DPDK  2.2.0
rte_crypto.h
Go to the documentation of this file.
1 /*-
2  * BSD LICENSE
3  *
4  * Copyright(c) 2015 Intel Corporation. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * * Neither the name of Intel Corporation nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef _RTE_CRYPTO_H_
34 #define _RTE_CRYPTO_H_
35 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #include <rte_mbuf.h>
50 #include <rte_memory.h>
51 #include <rte_mempool.h>
52 
103 };
104 
111 };
112 
115  uint8_t *data;
116  phys_addr_t phys_addr;
117  size_t length;
118 };
119 
165 };
166 
238 };
239 
244 };
245 
266  uint32_t digest_length;
278  uint32_t add_auth_data_length;
306 };
307 
313 };
314 
328  union {
333  };
334 };
335 
344 };
345 
360 };
361 
370  enum rte_crypto_op_sess_type type;
371  enum rte_crypto_op_status status;
372 
373  struct {
374  struct rte_mbuf *m;
375  uint8_t offset;
376  } dst;
377 
378  union {
379  struct rte_cryptodev_session *session;
383  };
384 
385  struct {
386  struct {
387  uint32_t offset;
395  uint32_t length;
414  } to_cipher;
416  struct {
417  uint32_t offset;
432  uint32_t length;
446  } to_hash;
447  } data;
449  struct {
450  uint8_t *data;
477  size_t length;
495  } iv;
497  struct {
498  uint8_t *data;
525  uint32_t length;
526  } digest;
528  struct {
529  uint8_t *data;
572  uint32_t length;
573  } additional_auth;
576  struct rte_mempool *pool;
579  void *user_data;
581 };
582 
583 
589 static inline void
591 {
592  op->type = RTE_CRYPTO_OP_SESSIONLESS;
593  op->dst.m = NULL;
594  op->dst.offset = 0;
595 }
596 
598 static inline void
600  struct rte_cryptodev_session *sess)
601 {
602  op->session = sess;
603  op->type = RTE_CRYPTO_OP_WITH_SESSION;
604 }
605 
606 #ifdef __cplusplus
607 }
608 #endif
609 
610 #endif /* _RTE_CRYPTO_H_ */