/* encrypt and decrypt using DES in ECB mode  */
ErrStatus cau_des_ecb(uint32_t algo_dir, uint8_t key[24], cau_text_struct *text)
/* encrypt and decrypt using DES in ECB mode  */
ErrStatus cau_des_ecb(uint32_t algo_dir, uint8_t key[24], cau_text_struct *text)
{
    ErrStatus ret = ERROR;
    cau_key_parameter_struct key_initpara;
    uint32_t keyaddr = (uint32_t)key;
    cau_key_parameter_init(&key_initpara);
    cau_init(algo_dir, CAU_MODE_DES_ECB, CAU_SWAPPING_8BIT);
    key_initpara.key_1_high = __REV(*(uint32_t*)(keyaddr));
    keyaddr += 4U;
    key_initpara.key_1_low= __REV(*(uint32_t*)(keyaddr));
    cau_key_init(& key_initpara);
    cau_fifo_flush();
    cau_enable();
    ret = cau_des_calculate(text->input, text->in_length, text->output);
    cau_disable();
    return ret;
}