Path: blob/master/drivers/crypto/inside-secure/eip93/eip93-cipher.h
26285 views
/* SPDX-License-Identifier: GPL-2.01*2* Copyright (C) 2019 - 20213*4* Richard van Schagen <[email protected]>5* Christian Marangi <[email protected]6*/7#ifndef _EIP93_CIPHER_H_8#define _EIP93_CIPHER_H_910#include "eip93-main.h"1112struct eip93_crypto_ctx {13struct eip93_device *eip93;14u32 flags;15struct sa_record *sa_record;16u32 sa_nonce;17int blksize;18dma_addr_t sa_record_base;19/* AEAD specific */20unsigned int authsize;21unsigned int assoclen;22bool set_assoc;23enum eip93_alg_type type;24};2526struct eip93_cipher_reqctx {27u16 desc_flags;28u16 flags;29unsigned int blksize;30unsigned int ivsize;31unsigned int textsize;32unsigned int assoclen;33unsigned int authsize;34dma_addr_t sa_record_base;35struct sa_state *sa_state;36dma_addr_t sa_state_base;37struct eip93_descriptor *cdesc;38struct scatterlist *sg_src;39struct scatterlist *sg_dst;40int src_nents;41int dst_nents;42struct sa_state *sa_state_ctr;43dma_addr_t sa_state_ctr_base;44};4546int check_valid_request(struct eip93_cipher_reqctx *rctx);4748void eip93_unmap_dma(struct eip93_device *eip93, struct eip93_cipher_reqctx *rctx,49struct scatterlist *reqsrc, struct scatterlist *reqdst);5051void eip93_skcipher_handle_result(struct crypto_async_request *async, int err);5253int eip93_send_req(struct crypto_async_request *async,54const u8 *reqiv, struct eip93_cipher_reqctx *rctx);5556void eip93_handle_result(struct eip93_device *eip93, struct eip93_cipher_reqctx *rctx,57u8 *reqiv);5859#endif /* _EIP93_CIPHER_H_ */606162