libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
CMUTIL_BlockCrypto Struct Reference

Block cipher encryption/decryption object. More...

Data Fields

CMUTIL_String *(* Encrypt )(CMUTIL_BlockCrypto *crypto, CMUTIL_String *plain, const uint8_t *key, const uint8_t *iv)
 Encrypts plain text with the specified key and IV.
 
CMUTIL_String *(* Decrypt )(CMUTIL_BlockCrypto *crypto, CMUTIL_String *encrypted, const uint8_t *key, const uint8_t *iv)
 Decrypts encrypted data with the specified key and IV.
 
void(* Destroy )(CMUTIL_BlockCrypto *crypto)
 Destroys the block crypto object.
 

Detailed Description

Block cipher encryption/decryption object.

Field Documentation

◆ Encrypt

CMUTIL_String *(* CMUTIL_BlockCrypto::Encrypt) (CMUTIL_BlockCrypto *crypto, CMUTIL_String *plain, const uint8_t *key, const uint8_t *iv)

Encrypts plain text with the specified key and IV.

Parameters
cryptoThe block crypto object.
plainThe plain text to encrypt.
keyThe encryption key.
ivThe initialization vector.
Returns
The encrypted data as a CMUTIL_String object, or NULL on failure. Returned object must be destroyed by calling Destroy member.

◆ Decrypt

CMUTIL_String *(* CMUTIL_BlockCrypto::Decrypt) (CMUTIL_BlockCrypto *crypto, CMUTIL_String *encrypted, const uint8_t *key, const uint8_t *iv)

Decrypts encrypted data with the specified key and IV.

Parameters
cryptoThe block crypto object.
encryptedThe encrypted data to decrypt.
keyThe decryption key.
ivThe initialization vector.
Returns
The decrypted data as a CMUTIL_String object, or NULL on failure. Returned object must be destroyed by calling Destroy member.

◆ Destroy

void(* CMUTIL_BlockCrypto::Destroy) (CMUTIL_BlockCrypto *crypto)

Destroys the block crypto object.

Parameters
cryptoThe block crypto object to destroy.

The documentation for this struct was generated from the following file: