plusaes
|
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) |
ECB mode functions
|
inline |
Decrypts data with ECB mode.
[in] | data | Data bytes. |
[in] | data_size | Data size. |
[in] | key | Key bytes. |
[in] | key_size | Key size. |
[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 |
Encrypts data with ECB 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. |
[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. |