1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * Kernelspace interface to the pkey device driver 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Copyright IBM Corp. 2016,2019 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * Author: Harald Freudenberger <freude@de.ibm.com> 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun */ 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun #ifndef _KAPI_PKEY_H 12*4882a593Smuzhiyun #define _KAPI_PKEY_H 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun #include <linux/ioctl.h> 15*4882a593Smuzhiyun #include <linux/types.h> 16*4882a593Smuzhiyun #include <uapi/asm/pkey.h> 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun /* 19*4882a593Smuzhiyun * In-kernel API: Transform an key blob (of any type) into a protected key. 20*4882a593Smuzhiyun * @param key pointer to a buffer containing the key blob 21*4882a593Smuzhiyun * @param keylen size of the key blob in bytes 22*4882a593Smuzhiyun * @param protkey pointer to buffer receiving the protected key 23*4882a593Smuzhiyun * @return 0 on success, negative errno value on failure 24*4882a593Smuzhiyun */ 25*4882a593Smuzhiyun int pkey_keyblob2pkey(const u8 *key, u32 keylen, 26*4882a593Smuzhiyun struct pkey_protkey *protkey); 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun #endif /* _KAPI_PKEY_H */ 29