This function encrypts or decrypts a message of any size from the input buffer input, and stores the resulting plaintext/ciphertext in the output buffer output.
- Returns
- 0 Returned upon successfully encrypting/decrypting the given input
-
MEMORY_E Returned if the input and output buffers are not aligned along a 4-byte boundary, and there is an error allocating memory
-
BAD_ALIGN_E Returned if the input or output buffers are not aligned along a 4-byte boundary, and NO_WOLFSSL_ALLOC_ALIGN is defined
- Parameters
-
ctx | pointer to a HC-128 context object with an initialized key to use for encryption or decryption |
output | buffer in which to store the processed input |
input | buffer containing the plaintext to encrypt or the ciphertext to decrypt |
msglen | length of the plaintext to encrypt or the ciphertext to decrypt |
Example
HC128 enc;
byte key[] = {
byte iv[] = {
byte msg[] = {
byte cipher[sizeof(msg)];
}
- See also
- wc_Hc128_SetKey