File Index
Files and directories
Sign in
FILE

crypto.h

File preview with syntax highlighting.

linux-6.19.14/drivers/net/ethernet/mellanox/mlx5/core/lib/crypto.h C
 1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
 2/* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
 3
 4#ifndef __MLX5_LIB_CRYPTO_H__
 5#define __MLX5_LIB_CRYPTO_H__
 6
 7enum {
 8	MLX5_ACCEL_OBJ_TLS_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_PURPOSE_TLS,
 9	MLX5_ACCEL_OBJ_IPSEC_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_PURPOSE_IPSEC,
10	MLX5_ACCEL_OBJ_MACSEC_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_PURPOSE_MACSEC,
11	MLX5_ACCEL_OBJ_PSP_KEY = MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_PURPOSE_PSP,
12	MLX5_ACCEL_OBJ_TYPE_KEY_NUM,
13};
14
15int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
16			       const void *key, u32 sz_bytes,
17			       u32 key_type, u32 *p_key_id);
18
19void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 key_id);
20
21struct mlx5_crypto_dek_pool;
22struct mlx5_crypto_dek;
23
24struct mlx5_crypto_dek_pool *mlx5_crypto_dek_pool_create(struct mlx5_core_dev *mdev,
25							 int key_purpose);
26void mlx5_crypto_dek_pool_destroy(struct mlx5_crypto_dek_pool *pool);
27struct mlx5_crypto_dek *mlx5_crypto_dek_create(struct mlx5_crypto_dek_pool *dek_pool,
28					       const void *key, u32 sz_bytes);
29void mlx5_crypto_dek_destroy(struct mlx5_crypto_dek_pool *dek_pool,
30			     struct mlx5_crypto_dek *dek);
31u32 mlx5_crypto_dek_get_id(struct mlx5_crypto_dek *dek);
32
33struct mlx5_crypto_dek_priv *mlx5_crypto_dek_init(struct mlx5_core_dev *mdev);
34void mlx5_crypto_dek_cleanup(struct mlx5_crypto_dek_priv *dek_priv);
35#endif /* __MLX5_LIB_CRYPTO_H__ */
~/ Read-only file preview.