plusaes
ECB

Functions

Error plusaes::encrypt_ecb (const unsigned char *data, const unsigned long data_size, const unsigned char *key, const unsigned long key_size, unsigned char *encrypted, const unsigned long encrypted_size, const bool pads)
 
Error plusaes::decrypt_ecb (const unsigned char *data, const unsigned long data_size, const unsigned char *key, const unsigned long key_size, unsigned char *decrypted, const unsigned long decrypted_size, unsigned long *padded_size)
 

Detailed Description

ECB mode functions

Function Documentation

◆ decrypt_ecb()

Error plusaes::decrypt_ecb ( const unsigned char *  data,
const unsigned long  data_size,
const unsigned char *  key,
const unsigned long  key_size,
unsigned char *  decrypted,
const unsigned long  decrypted_size,
unsigned long *  padded_size 
)
inline

Decrypts data with ECB mode.

Parameters
[in]dataData bytes.
[in]data_sizeData size.
[in]keyKey bytes.
[in]key_sizeKey size.
[out]decryptedDecrypted data buffer.
[in]decrypted_sizeDecrypted data buffer size.
[out]padded_sizeIf this value is NULL, this function does not remove padding. If this value is not NULL, this function removes padding by PKCS and returns padded size using padded_size.
Since
1.0.0

◆ encrypt_ecb()

Error plusaes::encrypt_ecb ( const unsigned char *  data,
const unsigned long  data_size,
const unsigned char *  key,
const unsigned long  key_size,
unsigned char *  encrypted,
const unsigned long  encrypted_size,
const bool  pads 
)
inline

Encrypts data with ECB mode.

Parameters
[in]dataData.
[in]data_sizeData size. If the pads is false, data size must be multiple of 16.
[in]keykey bytes. The key length must be 16 (128-bit), 24 (192-bit) or 32 (256-bit).
[in]key_sizekey size.
[out]encryptedEncrypted data buffer.
[in]encrypted_sizeEncrypted data buffer size.
[in]padsIf this value is true, encrypted data is padded by PKCS. Encrypted data size must be multiple of 16. If the pads is true, encrypted data is padded with PKCS. So the data is multiple of 16, encrypted data size needs additonal 16 bytes.
Since
1.0.0