xref: /freebsd/sys/dev/mlx5/crypto.h (revision e23731db48ef9c6568d4768b1f87d48514339faa)
1*e23731dbSKonstantin Belousov /*-
2*e23731dbSKonstantin Belousov  * Copyright (c) 2023, NVIDIA Technologies. All rights reserved.
3*e23731dbSKonstantin Belousov  *
4*e23731dbSKonstantin Belousov  * Redistribution and use in source and binary forms, with or without
5*e23731dbSKonstantin Belousov  * modification, are permitted provided that the following conditions
6*e23731dbSKonstantin Belousov  * are met:
7*e23731dbSKonstantin Belousov  * 1. Redistributions of source code must retain the above copyright
8*e23731dbSKonstantin Belousov  *    notice, this list of conditions and the following disclaimer.
9*e23731dbSKonstantin Belousov  * 2. Redistributions in binary form must reproduce the above copyright
10*e23731dbSKonstantin Belousov  *    notice, this list of conditions and the following disclaimer in the
11*e23731dbSKonstantin Belousov  *    documentation and/or other materials provided with the distribution.
12*e23731dbSKonstantin Belousov  *
13*e23731dbSKonstantin Belousov  * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND
14*e23731dbSKonstantin Belousov  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*e23731dbSKonstantin Belousov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*e23731dbSKonstantin Belousov  * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
17*e23731dbSKonstantin Belousov  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*e23731dbSKonstantin Belousov  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*e23731dbSKonstantin Belousov  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*e23731dbSKonstantin Belousov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*e23731dbSKonstantin Belousov  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*e23731dbSKonstantin Belousov  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*e23731dbSKonstantin Belousov  * SUCH DAMAGE.
24*e23731dbSKonstantin Belousov  *
25*e23731dbSKonstantin Belousov  */
26*e23731dbSKonstantin Belousov 
27*e23731dbSKonstantin Belousov #ifndef __MLX5_CRYPTO_H__
28*e23731dbSKonstantin Belousov #define	__MLX5_CRYPTO_H__
29*e23731dbSKonstantin Belousov 
30*e23731dbSKonstantin Belousov struct mlx5_core_dev;
31*e23731dbSKonstantin Belousov 
32*e23731dbSKonstantin Belousov int mlx5_encryption_key_create(struct mlx5_core_dev *, u32 pdn, u32 key_type,
33*e23731dbSKonstantin Belousov     const void *p_key, u32 key_len, u32 *p_obj_id);
34*e23731dbSKonstantin Belousov int mlx5_encryption_key_destroy(struct mlx5_core_dev *mdev, u32 oid);
35*e23731dbSKonstantin Belousov 
36*e23731dbSKonstantin Belousov #endif					/* __MLX5_CRYPTO_H__ */
37