riot_sys

Function cipher_init

Source
pub unsafe extern "C" fn cipher_init(
    cipher: *mut cipher_t,
    cipher_id: cipher_id_t,
    key: *const u8,
    key_size: u8,
) -> c_int
Expand description

@brief Initialize new cipher state

@param cipher cipher struct to init (already allocated memory) @param cipher_id cipher algorithm id @param key encryption key to use @param key_size length of the encryption key

@return CIPHER_INIT_SUCCESS if the initialization was successful. @return CIPHER_ERR_BAD_CONTEXT_SIZE if CIPHER_MAX_CONTEXT_SIZE has not been defined (which means that the cipher has not been included in the build) @return The command may return CIPHER_ERR_INVALID_KEY_SIZE if the key size is not valid.