/* Initialize SHA Interface. 1. Initializes the resources needed for the SHA interface 2.registers event callback function.  */
sha_handle_t csi_sha_initialize(int32_t idx, sha_event_cb_t cb_event)
/* Initialize SHA Interface. 1. Initializes the resources needed for the SHA interface 2.registers event callback function.  */
sha_handle_t csi_sha_initialize(int32_t idx, sha_event_cb_t cb_event)
{
    if (idx < 0 || idx >= CONFIG_SHA_NUM) {
        return NULL;
    }
    uint32_t base = 0u;
    uint32_t irq;
    int32_t real_idx = target_get_sha(idx, &base, &irq);
    if (real_idx != idx) {
        return NULL;
    }
    ck_sha_priv_t *sha_priv = &sha_handle[idx];
    sha_priv->base = base;
    sha_priv->irq  = irq;
    sha_priv->cb = cb_event;
    sha_priv->status.busy = 0;
    drv_nvic_enable_irq(sha_priv->irq);
    return (sha_handle_t)sha_priv;
}