drivers/s390/crypto/zcrypt_ccamisc.h

Source file repositories/reference/linux-study-clean/drivers/s390/crypto/zcrypt_ccamisc.h

File Facts

System
Linux kernel
Corpus path
drivers/s390/crypto/zcrypt_ccamisc.h
Extension
.h
Size
9886 bytes
Lines
269
Domain
Driver Families
Bucket
drivers/s390
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 keytoken_header {
	u8  type;     /* one of the TOKTYPE values */
	u8  res0[1];
	u16 len;      /* vlsc token: total length in bytes */
	u8  version;  /* one of the TOKVER values */
	u8  res1[3];
} __packed;

/* inside view of a CCA secure key token (only type 0x01 version 0x04) */
struct secaeskeytoken {
	u8  type;     /* 0x01 for internal key token */
	u8  res0[3];
	u8  version;  /* should be 0x04 */
	u8  res1[1];
	u8  flag;     /* key flags */
	u8  res2[1];
	u8  mkvp[8];  /* master key verification pattern */
	u8  key[32];  /* key value (encrypted) */
	u8  cv[8];    /* control vector */
	u16 bitsize;  /* key bit size */
	u16 keysize;  /* key byte size */
	u8  tvv[4];   /* token validation value */
} __packed;

/* inside view of a variable length symmetric cipher AES key token */
struct cipherkeytoken {
	u8  type;     /* 0x01 for internal key token */
	u8  res0[1];
	u16 len;      /* total key token length in bytes */
	u8  version;  /* should be 0x05 */
	u8  res1[3];
	u8  kms;      /* key material state, 0x03 means wrapped with MK */
	u8  kvpt;     /* key verification pattern type, should be 0x01 */
	u8  mkvp0[8]; /* master key verification pattern, lo part */
	u8  mkvp1[8]; /* master key verification pattern, hi part (unused) */
	u8  eskwm;    /* encrypted section key wrapping method */
	u8  hashalg;  /* hash algorithmus used for wrapping key */
	u8  plfver;   /* pay load format version */
	u8  res2[1];
	u8  adsver;   /* associated data section version */
	u8  res3[1];
	u16 adslen;   /* associated data section length */
	u8  kllen;    /* optional key label length */
	u8  ieaslen;  /* optional extended associated data length */
	u8  uadlen;   /* optional user definable associated data length */
	u8  res4[1];
	u16 wpllen;   /* wrapped payload length in bits: */
		      /*   plfver  0x00 0x01		 */
		      /*   AES-128  512  640		 */
		      /*   AES-192  576  640		 */
		      /*   AES-256  640  640		 */
	u8  res5[1];
	u8  algtype;  /* 0x02 for AES cipher */
	u16 keytype;  /* 0x0001 for 'cipher' */
	u8  kufc;     /* key usage field count */
	u16 kuf1;     /* key usage field 1 */
	u16 kuf2;     /* key usage field 2 */
	u8  kmfc;     /* key management field count */
	u16 kmf1;     /* key management field 1 */
	u16 kmf2;     /* key management field 2 */
	u16 kmf3;     /* key management field 3 */
	u8  vdata[]; /* variable part data follows */
} __packed;

/* inside view of an CCA secure ECC private key */
struct eccprivkeytoken {
	u8  type;     /* 0x1f for internal asym key token */
	u8  version;  /* should be 0x00 */
	u16 len;      /* total key token length in bytes */
	u8  res1[4];
	u8  secid;    /* 0x20 for ECC priv key section marker */
	u8  secver;   /* section version */
	u16 seclen;   /* section length */
	u8  wtype;    /* wrapping method, 0x00 clear, 0x01 AES */
	u8  htype;    /* hash method, 0x02 for SHA-256 */
	u8  res2[2];
	u8  kutc;     /* key usage and translation control */
	u8  ctype;    /* curve type */
	u8  kfs;      /* key format and security */
	u8  ksrc;     /* key source */
	u16 pbitlen;  /* length of prime p in bits */
	u16 ibmadlen; /* IBM associated data length in bytes */
	u8  mkvp[8];  /* master key verification pattern */
	u8  opk[48];  /* encrypted object protection key data */
	u16 adatalen; /* associated data length in bytes */
	u16 fseclen;  /* formatted section length in bytes */
	u8  more_data[]; /* more data follows */
} __packed;

/* Some defines for the CCA AES cipherkeytoken kmf1 field */

Annotation

Implementation Notes