This function encrypts or decrypts a message of any size, storing the result in output. It requires that the Rabbit ctx structure be initialized with a key and an iv before encryption.
- Returns
- 0 Returned on successfully encrypting/decrypting input
-
BAD_ALIGN_E Returned if the input message is not 4-byte aligned but is required to be by XSTREAM_ALIGN, but NO_WOLFSSL_ALLOC_ALIGN is defined
-
MEMORY_E Returned if there is an error allocating memory to align the message, if NO_WOLFSSL_ALLOC_ALIGN is not defined
- Parameters
-
ctx | pointer to the Rabbit structure to use for encryption/decryption |
output | pointer to the buffer in which to store the processed message. Should be at least msglen long |
input | pointer to the buffer containing the message to process |
msglen | the length of the message to process |
Example
int ret;
Rabbit enc;
byte key[] = { };
byte iv[] = { };
byte message[] = { };
byte ciphertext[sizeof(message)];
- See also
- wc_RabbitSetKey