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

AES-ECB API. More...

Go to the source code of this file.

Functions

int zpc_aes_ecb_alloc (struct zpc_aes_ecb **ctx)
int zpc_aes_ecb_set_key (struct zpc_aes_ecb *ctx, struct zpc_aes_key *key)
int zpc_aes_ecb_encrypt (struct zpc_aes_ecb *ctx, unsigned char *ct, const unsigned char *pt, size_t ptlen)
int zpc_aes_ecb_decrypt (struct zpc_aes_ecb *ctx, unsigned char *pt, const unsigned char *ct, size_t ctlen)
void zpc_aes_ecb_free (struct zpc_aes_ecb **ctx)

Detailed Description

AES-ECB API.

Encryption API for the Advanced Encryption Standard (AES) block cipher [1] in Electronic Code Book (ECB) mode of operation [8] .

Definition in file aes_ecb.h.

Function Documentation

◆ zpc_aes_ecb_alloc()

int zpc_aes_ecb_alloc ( struct zpc_aes_ecb ** ctx)

Allocate a new context for an AES-ECB operation.

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

◆ zpc_aes_ecb_set_key()

int zpc_aes_ecb_set_key ( struct zpc_aes_ecb * ctx,
struct zpc_aes_key * key )

Set the key to be used in the context of an AES-ECB operation.

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

◆ zpc_aes_ecb_encrypt()

int zpc_aes_ecb_encrypt ( struct zpc_aes_ecb * ctx,
unsigned char * ct,
const unsigned char * pt,
size_t ptlen )

Do an AES-ECB encryption operation.

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

◆ zpc_aes_ecb_decrypt()

int zpc_aes_ecb_decrypt ( struct zpc_aes_ecb * ctx,
unsigned char * pt,
const unsigned char * ct,
size_t ctlen )

Do an AES-ECB decryption operation.

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

◆ zpc_aes_ecb_free()

void zpc_aes_ecb_free ( struct zpc_aes_ecb ** ctx)

Free an AES-ECB context.

Parameters
[in,out]ctxAES-ECB context