linux/drivers/crypto/qce/common.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
 */

#ifndef _COMMON_H_
#define _COMMON_H_

#include <linux/crypto.h>
#include <linux/types.h>
#include <crypto/aes.h>
#include <crypto/hash.h>
#include <crypto/internal/skcipher.h>
#include <crypto/internal/aead.h>

/* xts du size */
#define QCE_SECTOR_SIZE

/* key size in bytes */
#define QCE_SHA_HMAC_KEY_SIZE
#define QCE_MAX_CIPHER_KEY_SIZE

/* IV length in bytes */
#define QCE_AES_IV_LENGTH
/* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */
#define QCE_MAX_IV_SIZE

/* maximum nonce bytes  */
#define QCE_MAX_NONCE
#define QCE_MAX_NONCE_WORDS

/* burst size alignment requirement */
#define QCE_MAX_ALIGN_SIZE

/* cipher algorithms */
#define QCE_ALG_DES
#define QCE_ALG_3DES
#define QCE_ALG_AES

/* hash and hmac algorithms */
#define QCE_HASH_SHA1
#define QCE_HASH_SHA256
#define QCE_HASH_SHA1_HMAC
#define QCE_HASH_SHA256_HMAC
#define QCE_HASH_AES_CMAC

/* cipher modes */
#define QCE_MODE_CBC
#define QCE_MODE_ECB
#define QCE_MODE_CTR
#define QCE_MODE_XTS
#define QCE_MODE_CCM
#define QCE_MODE_MASK

#define QCE_MODE_CCM_RFC4309

/* cipher encryption/decryption operations */
#define QCE_ENCRYPT
#define QCE_DECRYPT

#define IS_DES(flags)
#define IS_3DES(flags)
#define IS_AES(flags)

#define IS_SHA1(flags)
#define IS_SHA256(flags)
#define IS_SHA1_HMAC(flags)
#define IS_SHA256_HMAC(flags)
#define IS_CMAC(flags)
#define IS_SHA(flags)
#define IS_SHA_HMAC(flags)

#define IS_CBC(mode)
#define IS_ECB(mode)
#define IS_CTR(mode)
#define IS_XTS(mode)
#define IS_CCM(mode)
#define IS_CCM_RFC4309(mode)

#define IS_ENCRYPT(dir)
#define IS_DECRYPT(dir)

struct qce_alg_template {};

void qce_cpu_to_be32p_array(__be32 *dst, const u8 *src, unsigned int len);
int qce_check_status(struct qce_device *qce, u32 *status);
void qce_get_version(struct qce_device *qce, u32 *major, u32 *minor, u32 *step);
int qce_start(struct crypto_async_request *async_req, u32 type);

#endif /* _COMMON_H_ */