The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/qat/include/qat_ocf_utils.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* SPDX-License-Identifier: BSD-3-Clause */
    2 /* Copyright(c) 2007-2022 Intel Corporation */
    3 /* $FreeBSD$ */
    4 #ifndef _QAT_OCF_UTILS_H_
    5 #define _QAT_OCF_UTILS_H_
    6 /* System headers */
    7 #include <sys/types.h>
    8 #include <sys/mbuf.h>
    9 #include <machine/bus_dma.h>
   10 
   11 /* Cryptodev headers */
   12 #include <opencrypto/cryptodev.h>
   13 #include <crypto/sha2/sha512.h>
   14 
   15 /* QAT specific headers */
   16 #include "qat_ocf_mem_pool.h"
   17 #include "cpa.h"
   18 #include "cpa_cy_sym_dp.h"
   19 
   20 static inline CpaBoolean
   21 is_gmac_exception(const struct crypto_session_params *csp)
   22 {
   23         if (CSP_MODE_DIGEST == csp->csp_mode)
   24                 if (CRYPTO_AES_NIST_GMAC == csp->csp_auth_alg)
   25                         return CPA_TRUE;
   26 
   27         return CPA_FALSE;
   28 }
   29 
   30 static inline CpaBoolean
   31 is_sep_aad_supported(const struct crypto_session_params *csp)
   32 {
   33         if (CPA_TRUE == is_gmac_exception(csp))
   34                 return CPA_FALSE;
   35 
   36         if (CSP_MODE_AEAD == csp->csp_mode)
   37                 if (CRYPTO_AES_NIST_GCM_16 == csp->csp_cipher_alg ||
   38                     CRYPTO_AES_NIST_GMAC == csp->csp_cipher_alg)
   39                         return CPA_TRUE;
   40 
   41         return CPA_FALSE;
   42 }
   43 
   44 static inline CpaBoolean
   45 is_use_sep_digest(const struct crypto_session_params *csp)
   46 {
   47         /* Use separated digest for all digest/hash operations,
   48          * including GMAC. ETA and AEAD use separated digest
   49          * due to FW limitation to specify offset to digest
   50          * appended to pay-load buffer. */
   51         if (CSP_MODE_DIGEST == csp->csp_mode || CSP_MODE_ETA == csp->csp_mode ||
   52             CSP_MODE_AEAD == csp->csp_mode)
   53                 return CPA_TRUE;
   54 
   55         return CPA_FALSE;
   56 }
   57 
   58 int qat_ocf_handle_session_update(struct qat_ocf_dsession *ocf_dsession,
   59                                   struct cryptop *crp);
   60 
   61 CpaStatus qat_ocf_wait_for_session(CpaCySymSessionCtx sessionCtx,
   62                                    Cpa32U timeoutMS);
   63 
   64 #endif /* _QAT_OCF_UTILS_H_ */

Cache object: 6e08721165bd529f79b10f3269415da1


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.