libzpc 1.5
IBM Z Protected-key Crypto library
Loading...
Searching...
No Matches
aes_xts_full.h File Reference

AES-XTS-FULL API. More...

Go to the source code of this file.

Functions

int zpc_aes_xts_full_alloc (struct zpc_aes_xts_full **ctx)
int zpc_aes_xts_full_set_key (struct zpc_aes_xts_full *ctx, struct zpc_aes_xts_key *key)
int zpc_aes_xts_full_set_iv (struct zpc_aes_xts_full *ctx, const unsigned char *iv)
int zpc_aes_xts_full_export (struct zpc_aes_xts_full *ctx, unsigned char state[32])
int zpc_aes_xts_full_import (struct zpc_aes_xts_full *ctx, const unsigned char state[32])
int zpc_aes_xts_full_encrypt (struct zpc_aes_xts_full *ctx, unsigned char *ct, const unsigned char *pt, size_t ptlen)
int zpc_aes_xts_full_decrypt (struct zpc_aes_xts_full *ctx, unsigned char *pt, const unsigned char *ct, size_t ctlen)
void zpc_aes_xts_full_free (struct zpc_aes_xts_full **ctx)

Detailed Description

AES-XTS-FULL API.

Encryption API for the Advanced Encryption Standard (AES) block cipher [1] in XEX-based Tweaked-codebook mode with ciphertext Stealing (XTS) mode of operation [9] .

In contrast to the AES-XTS API, the AES-XTS-FULL API uses full-xts protected keys containing two single AES keys in one single protected key. This feature requires MSA 10.

Definition in file aes_xts_full.h.

Function Documentation

◆ zpc_aes_xts_full_alloc()

int zpc_aes_xts_full_alloc ( struct zpc_aes_xts_full ** ctx)

Allocate a new context for an AES-XTS operation to be used with an AES full-xts key object..

Parameters
[in,out]ctxAES-FULL-XTS context
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_aes_xts_full_set_key()

int zpc_aes_xts_full_set_key ( struct zpc_aes_xts_full * ctx,
struct zpc_aes_xts_key * key )

Set the AES full-xts key to be used in the context of an AES-XTS operation.

Parameters
[in,out]ctxAES-FULL-XTS context
[in]keyfull-xts key
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_aes_xts_full_set_iv()

int zpc_aes_xts_full_set_iv ( struct zpc_aes_xts_full * ctx,
const unsigned char * iv )

Set the initialization vector to be used in the context of an AES-XTS operation.

Parameters
[in,out]ctxAES-FULL-XTS context
[in]iv16 byte initialization vector
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_aes_xts_full_export()

int zpc_aes_xts_full_export ( struct zpc_aes_xts_full * ctx,
unsigned char state[32] )

Get the intermediate state information used in the context of an AES-XTS operation.

Parameters
[in,out]ctxAES-FULL-XTS context
[out]stateapplication provided buffer with 32 bytes size to receive the 32 byte intermediate state information.
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_aes_xts_full_import()

int zpc_aes_xts_full_import ( struct zpc_aes_xts_full * ctx,
const unsigned char state[32] )

Set the intermediate state information to be used in the context of an AES-XTS operation.

Parameters
[in,out]ctxAES-FULL-XTS context
[in]state32 byte intermediate state information as obtained via zpc_aes_xts_full_export().
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_aes_xts_full_encrypt()

int zpc_aes_xts_full_encrypt ( struct zpc_aes_xts_full * ctx,
unsigned char * ct,
const unsigned char * pt,
size_t ptlen )

Do an AES-XTS encryption operation.

Parameters
[in,out]ctxAES-FULL-XTS context
[out]ctciphertext
[in]ptplaintext
[in]ptlenplaintext length [bytes]
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_aes_xts_full_decrypt()

int zpc_aes_xts_full_decrypt ( struct zpc_aes_xts_full * ctx,
unsigned char * pt,
const unsigned char * ct,
size_t ctlen )

Do an AES-XTS decryption operation.

Parameters
[in,out]ctxAES-FULL-XTS context
[out]ptplaintext
[in]ctciphertext
[in]ctlenciphertext length [bytes]
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_aes_xts_full_free()

void zpc_aes_xts_full_free ( struct zpc_aes_xts_full ** ctx)

Free an AES-FULL-XTS context.

Parameters
[in,out]ctxAES-FULL-XTS context