plusaes
|
Functions | |
Error | plusaes::encrypt_cbc (const unsigned char *data, const unsigned long data_size, const unsigned char *key, const unsigned long key_size, const unsigned char(*iv)[16], unsigned char *encrypted, const unsigned long encrypted_size, const bool pads) |
Error | plusaes::decrypt_cbc (const unsigned char *data, const unsigned long data_size, const unsigned char *key, const unsigned long key_size, const unsigned char(*iv)[16], unsigned char *decrypted, const unsigned long decrypted_size, unsigned long *padded_size) |
CBC mode functions
|
inline |
Decrypt data with CBC mode.
[in] | data | Data bytes. |
[in] | data_size | Data size. |
[in] | key | Key bytes. |
[in] | key_size | Key size. |
[in] | iv | Initialize vector. |
[out] | decrypted | Decrypted data buffer. |
[in] | decrypted_size | Decrypted data buffer size. |
[out] | padded_size | If 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. |
|
inline |
Encrypt data with CBC mode.
[in] | data | Data. |
[in] | data_size | Data size. If the pads is false, data size must be multiple of 16. |
[in] | key | key bytes. The key length must be 16 (128-bit), 24 (192-bit) or 32 (256-bit). |
[in] | key_size | key size. |
[in] | iv | Initialize vector. |
[out] | encrypted | Encrypted data buffer. |
[in] | encrypted_size | Encrypted data buffer size. |
[in] | pads | If 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. |