include/uapi/linux/virtio_crypto.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/virtio_crypto.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/virtio_crypto.h- Extension
.h- Size
- 16523 bytes
- Lines
- 532
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/virtio_types.hlinux/virtio_ids.hlinux/virtio_config.h
Detected Declarations
struct virtio_crypto_ctrl_headerstruct virtio_crypto_cipher_session_parastruct virtio_crypto_session_inputstruct virtio_crypto_cipher_session_reqstruct virtio_crypto_hash_session_parastruct virtio_crypto_hash_create_session_reqstruct virtio_crypto_mac_session_parastruct virtio_crypto_mac_create_session_reqstruct virtio_crypto_aead_session_parastruct virtio_crypto_aead_create_session_reqstruct virtio_crypto_rsa_session_parastruct virtio_crypto_ecdsa_session_parastruct virtio_crypto_akcipher_session_parastruct virtio_crypto_akcipher_create_session_reqstruct virtio_crypto_alg_chain_session_parastruct virtio_crypto_alg_chain_session_reqstruct virtio_crypto_sym_create_session_reqstruct virtio_crypto_destroy_session_reqstruct virtio_crypto_op_ctrl_reqstruct virtio_crypto_op_headerstruct virtio_crypto_cipher_parastruct virtio_crypto_hash_parastruct virtio_crypto_mac_parastruct virtio_crypto_aead_parastruct virtio_crypto_cipher_data_reqstruct virtio_crypto_hash_data_reqstruct virtio_crypto_mac_data_reqstruct virtio_crypto_alg_chain_data_parastruct virtio_crypto_alg_chain_data_reqstruct virtio_crypto_sym_data_reqstruct virtio_crypto_aead_data_reqstruct virtio_crypto_akcipher_parastruct virtio_crypto_akcipher_data_reqstruct virtio_crypto_op_data_reqstruct virtio_crypto_configstruct virtio_crypto_inhdr
Annotated Snippet
struct virtio_crypto_ctrl_header {
#define VIRTIO_CRYPTO_CIPHER_CREATE_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_CIPHER, 0x02)
#define VIRTIO_CRYPTO_CIPHER_DESTROY_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_CIPHER, 0x03)
#define VIRTIO_CRYPTO_HASH_CREATE_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_HASH, 0x02)
#define VIRTIO_CRYPTO_HASH_DESTROY_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_HASH, 0x03)
#define VIRTIO_CRYPTO_MAC_CREATE_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_MAC, 0x02)
#define VIRTIO_CRYPTO_MAC_DESTROY_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_MAC, 0x03)
#define VIRTIO_CRYPTO_AEAD_CREATE_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x02)
#define VIRTIO_CRYPTO_AEAD_DESTROY_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x03)
#define VIRTIO_CRYPTO_AKCIPHER_CREATE_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x04)
#define VIRTIO_CRYPTO_AKCIPHER_DESTROY_SESSION \
VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x05)
__le32 opcode;
__le32 algo;
__le32 flag;
/* data virtqueue id */
__le32 queue_id;
};
struct virtio_crypto_cipher_session_para {
#define VIRTIO_CRYPTO_NO_CIPHER 0
#define VIRTIO_CRYPTO_CIPHER_ARC4 1
#define VIRTIO_CRYPTO_CIPHER_AES_ECB 2
#define VIRTIO_CRYPTO_CIPHER_AES_CBC 3
#define VIRTIO_CRYPTO_CIPHER_AES_CTR 4
#define VIRTIO_CRYPTO_CIPHER_DES_ECB 5
#define VIRTIO_CRYPTO_CIPHER_DES_CBC 6
#define VIRTIO_CRYPTO_CIPHER_3DES_ECB 7
#define VIRTIO_CRYPTO_CIPHER_3DES_CBC 8
#define VIRTIO_CRYPTO_CIPHER_3DES_CTR 9
#define VIRTIO_CRYPTO_CIPHER_KASUMI_F8 10
#define VIRTIO_CRYPTO_CIPHER_SNOW3G_UEA2 11
#define VIRTIO_CRYPTO_CIPHER_AES_F8 12
#define VIRTIO_CRYPTO_CIPHER_AES_XTS 13
#define VIRTIO_CRYPTO_CIPHER_ZUC_EEA3 14
__le32 algo;
/* length of key */
__le32 keylen;
#define VIRTIO_CRYPTO_OP_ENCRYPT 1
#define VIRTIO_CRYPTO_OP_DECRYPT 2
/* encrypt or decrypt */
__le32 op;
__le32 padding;
};
struct virtio_crypto_session_input {
/* Device-writable part */
__le64 session_id;
__le32 status;
__le32 padding;
};
struct virtio_crypto_cipher_session_req {
struct virtio_crypto_cipher_session_para para;
__u8 padding[32];
};
struct virtio_crypto_hash_session_para {
#define VIRTIO_CRYPTO_NO_HASH 0
#define VIRTIO_CRYPTO_HASH_MD5 1
#define VIRTIO_CRYPTO_HASH_SHA1 2
#define VIRTIO_CRYPTO_HASH_SHA_224 3
#define VIRTIO_CRYPTO_HASH_SHA_256 4
#define VIRTIO_CRYPTO_HASH_SHA_384 5
#define VIRTIO_CRYPTO_HASH_SHA_512 6
#define VIRTIO_CRYPTO_HASH_SHA3_224 7
#define VIRTIO_CRYPTO_HASH_SHA3_256 8
#define VIRTIO_CRYPTO_HASH_SHA3_384 9
#define VIRTIO_CRYPTO_HASH_SHA3_512 10
#define VIRTIO_CRYPTO_HASH_SHA3_SHAKE128 11
#define VIRTIO_CRYPTO_HASH_SHA3_SHAKE256 12
__le32 algo;
/* hash result length */
__le32 hash_result_len;
__u8 padding[8];
};
struct virtio_crypto_hash_create_session_req {
struct virtio_crypto_hash_session_para para;
__u8 padding[40];
Annotation
- Immediate include surface: `linux/types.h`, `linux/virtio_types.h`, `linux/virtio_ids.h`, `linux/virtio_config.h`.
- Detected declarations: `struct virtio_crypto_ctrl_header`, `struct virtio_crypto_cipher_session_para`, `struct virtio_crypto_session_input`, `struct virtio_crypto_cipher_session_req`, `struct virtio_crypto_hash_session_para`, `struct virtio_crypto_hash_create_session_req`, `struct virtio_crypto_mac_session_para`, `struct virtio_crypto_mac_create_session_req`, `struct virtio_crypto_aead_session_para`, `struct virtio_crypto_aead_create_session_req`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.