Skip to main content
Version: 0.2.1

Camellia - OFB

Camellia in OFB (Output Feedback) mode: the IV or previous keystream block is encrypted to produce the next keystream block, which is XORed with the plaintext. Same semantics as AES OFB. IV must be unique per encryption.

API

noxtls_camellia_encrypt_ofb

noxtls_return_t noxtls_camellia_encrypt_ofb(const uint8_t* key, const uint8_t* data, uint32_t data_len, const uint8_t* iv, uint8_t* output, noxtls_camellia_type_t type);

Encrypts data in Camellia OFB mode (output feedback; keystream from repeatedly encrypting IV/keystream).

Parameters: key — encryption key; data — plaintext; data_len — length; iv — 16-byte IV (unique per encryption); output — ciphertext buffer; type — Camellia key type.

Returns: noxtls_return_t: NOXTLS_RETURN_SUCCESS on success; otherwise a specific return code.

noxtls_camellia_decrypt_ofb

noxtls_return_t noxtls_camellia_decrypt_ofb(const uint8_t* key, const uint8_t* data, uint32_t data_len, const uint8_t* iv, uint8_t* output, noxtls_camellia_type_t type);

Decrypts data in Camellia OFB mode (same keystream as encrypt). Use the same IV that was used for encryption.

Parameters: key — decryption key; data — ciphertext; data_len — length; iv — 16-byte IV used for this ciphertext; output — plaintext buffer; type — Camellia key type.

Returns: noxtls_return_t: NOXTLS_RETURN_SUCCESS on success; otherwise a specific return code.