drivers/crypto/inside-secure/eip93/eip93-hash.h

Source file repositories/reference/linux-study-clean/drivers/crypto/inside-secure/eip93/eip93-hash.h

File Facts

System
Linux kernel
Corpus path
drivers/crypto/inside-secure/eip93/eip93-hash.h
Extension
.h
Size
2026 bytes
Lines
83
Domain
Driver Families
Bucket
drivers/crypto
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct eip93_hash_ctx {
	struct eip93_device	*eip93;
	u32			flags;

	u8			ipad[SHA256_BLOCK_SIZE] __aligned(sizeof(u32));
	u8			opad[SHA256_DIGEST_SIZE] __aligned(sizeof(u32));
};

struct eip93_hash_reqctx {
	/* Placement is important for DMA align */
	struct {
		struct sa_record	sa_record;
		struct sa_record	sa_record_hmac;
		struct sa_state		sa_state;
	} __aligned(CRYPTO_DMA_ALIGN);

	dma_addr_t		sa_record_base;
	dma_addr_t		sa_record_hmac_base;
	dma_addr_t		sa_state_base;

	/* Don't enable HASH_FINALIZE when last block is sent */
	bool			partial_hash;

	/* Set to signal interrupt is for final packet */
	bool			finalize;

	/*
	 * EIP93 requires data to be accumulated in block of 64 bytes
	 * for intermediate hash calculation.
	 */
	u64			len;
	u32			data_used;

	u8			data[SHA256_BLOCK_SIZE] __aligned(sizeof(u32));
	dma_addr_t		data_dma;

	struct list_head	blocks;
};

struct mkt_hash_block {
	struct list_head	list;
	u8			data[SHA256_BLOCK_SIZE] __aligned(sizeof(u32));
	dma_addr_t		data_dma;
};

struct eip93_hash_export_state {
	u64			len;
	u32			data_used;

	u32			state_len[2];
	u8			state_hash[SHA256_DIGEST_SIZE] __aligned(sizeof(u32));

	u8			data[SHA256_BLOCK_SIZE] __aligned(sizeof(u32));
};

void eip93_hash_handle_result(struct crypto_async_request *async, int err);

extern struct eip93_alg_template eip93_alg_md5;
extern struct eip93_alg_template eip93_alg_sha1;
extern struct eip93_alg_template eip93_alg_sha224;
extern struct eip93_alg_template eip93_alg_sha256;
extern struct eip93_alg_template eip93_alg_hmac_md5;
extern struct eip93_alg_template eip93_alg_hmac_sha1;
extern struct eip93_alg_template eip93_alg_hmac_sha224;
extern struct eip93_alg_template eip93_alg_hmac_sha256;

#endif /* _EIP93_HASH_H_ */

Annotation

Implementation Notes