18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Kernelspace interface to the pkey device driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright IBM Corp. 2016,2019
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Author: Harald Freudenberger <freude@de.ibm.com>
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef _KAPI_PKEY_H
128c2ecf20Sopenharmony_ci#define _KAPI_PKEY_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/ioctl.h>
158c2ecf20Sopenharmony_ci#include <linux/types.h>
168c2ecf20Sopenharmony_ci#include <uapi/asm/pkey.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/*
198c2ecf20Sopenharmony_ci * In-kernel API: Transform an key blob (of any type) into a protected key.
208c2ecf20Sopenharmony_ci * @param key pointer to a buffer containing the key blob
218c2ecf20Sopenharmony_ci * @param keylen size of the key blob in bytes
228c2ecf20Sopenharmony_ci * @param protkey pointer to buffer receiving the protected key
238c2ecf20Sopenharmony_ci * @return 0 on success, negative errno value on failure
248c2ecf20Sopenharmony_ci */
258c2ecf20Sopenharmony_ciint pkey_keyblob2pkey(const u8 *key, u32 keylen,
268c2ecf20Sopenharmony_ci		      struct pkey_protkey *protkey);
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#endif /* _KAPI_PKEY_H */
29