aes-padlock

aes-padlock

Functions

Types and Values

Description

Functions

padlock_aes_cipher_setkey ()

int
padlock_aes_cipher_setkey (void *_ctx,
                           const void *userkey,
                           size_t keysize);

padlock_capability ()

unsigned int
padlock_capability (void);

padlock_reload_key ()

void
padlock_reload_key (void);

padlock_ecb_encrypt ()

int
padlock_ecb_encrypt (void *out,
                     const void *inp,
                     struct padlock_cipher_data *ctx,
                     size_t len);

padlock_cbc_encrypt ()

int
padlock_cbc_encrypt (void *out,
                     const void *inp,
                     struct padlock_cipher_data *ctx,
                     size_t len);

Types and Values

struct padlock_cipher_data

struct padlock_cipher_data {
	unsigned char iv[16]; /* Initialization vector */
	union {
		unsigned int pad[4];
		struct {
			unsigned rounds:4;
			unsigned dgst:1; /* n/a in C3 */
			unsigned align:1; /* n/a in C3 */
			unsigned ciphr:1; /* n/a in C3 */
			unsigned int keygen:1;
			unsigned interm:1;
			unsigned int encdec:1;
			unsigned ksize:2;
		} b;
	} cword;		/* Control word */
	AES_KEY ks;		/* Encryption key */
};

struct padlock_ctx

struct padlock_ctx {
	struct padlock_cipher_data expanded_key;
	int enc;
};