18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * pcrypt - Parallel crypto engine. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2009 secunet Security Networks AG 68c2ecf20Sopenharmony_ci * Copyright (C) 2009 Steffen Klassert <steffen.klassert@secunet.com> 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef _CRYPTO_PCRYPT_H 108c2ecf20Sopenharmony_ci#define _CRYPTO_PCRYPT_H 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <linux/crypto.h> 138c2ecf20Sopenharmony_ci#include <linux/kernel.h> 148c2ecf20Sopenharmony_ci#include <linux/padata.h> 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cistruct pcrypt_request { 178c2ecf20Sopenharmony_ci struct padata_priv padata; 188c2ecf20Sopenharmony_ci void *data; 198c2ecf20Sopenharmony_ci void *__ctx[] CRYPTO_MINALIGN_ATTR; 208c2ecf20Sopenharmony_ci}; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_cistatic inline void *pcrypt_request_ctx(struct pcrypt_request *req) 238c2ecf20Sopenharmony_ci{ 248c2ecf20Sopenharmony_ci return req->__ctx; 258c2ecf20Sopenharmony_ci} 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_cistatic inline 288c2ecf20Sopenharmony_cistruct padata_priv *pcrypt_request_padata(struct pcrypt_request *req) 298c2ecf20Sopenharmony_ci{ 308c2ecf20Sopenharmony_ci return &req->padata; 318c2ecf20Sopenharmony_ci} 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_cistatic inline 348c2ecf20Sopenharmony_cistruct pcrypt_request *pcrypt_padata_request(struct padata_priv *padata) 358c2ecf20Sopenharmony_ci{ 368c2ecf20Sopenharmony_ci return container_of(padata, struct pcrypt_request, padata); 378c2ecf20Sopenharmony_ci} 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci#endif 40