/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * AMCC SoC PPC4xx Crypto Driver * * Copyright (c) 2008 Applied Micro Circuits Corporation. * All rights reserved. James Hsiao <jhsiao@amcc.com> * * This is the header file for AMCC Crypto offload Linux device driver for * use with Linux CryptoAPI.
/* alloc 256 bytes which is enough for any kind of dynamic sa */
u8 buf[256];
} __packed;
struct pd_uinfo { struct crypto4xx_device *dev;
u32 state;
u32 first_gd; /* first gather discriptor
used by this packet */
u32 num_gd; /* number of gather discriptor
used by this packet */
u32 first_sd; /* first scatter discriptor
used by this packet */
u32 num_sd; /* number of scatter discriptors
used by this packet */ struct dynamic_sa_ctl *sa_va; /* shadow sa */ struct sa_state_record *sr_va; /* state record for shadow sa */
u32 sr_pa; struct scatterlist *dest_va; struct crypto_async_request *async_req; /* base crypto request
for this packet */
};
int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); int crypto4xx_build_pd(struct crypto_async_request *req, struct crypto4xx_ctx *ctx, struct scatterlist *src, struct scatterlist *dst, constunsignedint datalen, constvoid *iv, const u32 iv_len, conststruct dynamic_sa_ctl *sa, constunsignedint sa_len, constunsignedint assoclen, struct scatterlist *dst_tmp) BUILD_PD_ACCESS; int crypto4xx_setkey_aes_cbc(struct crypto_skcipher *cipher, const u8 *key, unsignedint keylen); int crypto4xx_setkey_aes_ctr(struct crypto_skcipher *cipher, const u8 *key, unsignedint keylen); int crypto4xx_setkey_aes_ecb(struct crypto_skcipher *cipher, const u8 *key, unsignedint keylen); int crypto4xx_setkey_rfc3686(struct crypto_skcipher *cipher, const u8 *key, unsignedint keylen); int crypto4xx_encrypt_ctr(struct skcipher_request *req); int crypto4xx_decrypt_ctr(struct skcipher_request *req); int crypto4xx_encrypt_iv_stream(struct skcipher_request *req); int crypto4xx_decrypt_iv_stream(struct skcipher_request *req); int crypto4xx_encrypt_iv_block(struct skcipher_request *req); int crypto4xx_decrypt_iv_block(struct skcipher_request *req); int crypto4xx_encrypt_noiv_block(struct skcipher_request *req); int crypto4xx_decrypt_noiv_block(struct skcipher_request *req); int crypto4xx_rfc3686_encrypt(struct skcipher_request *req); int crypto4xx_rfc3686_decrypt(struct skcipher_request *req);
/* * Note: Only use this function to copy items that is word aligned.
*/ staticinlinevoid crypto4xx_memcpy_swab32(u32 *dst, constvoid *buf,
size_t len)
{ for (; len >= 4; buf += 4, len -= 4)
*dst++ = __swab32p((u32 *) buf);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.