+static int cmac_init(void *vmacctx, const unsigned char *key,
+ size_t keylen, const OSSL_PARAM params[])
+{
+ struct cmac_data_st *macctx = vmacctx;
+
+ if (!ossl_prov_is_running() || !cmac_set_ctx_params(macctx, params))
+ return 0;
+ if (key != NULL)
+ return cmac_setkey(macctx, key, keylen);
+ /* Reinitialize the CMAC context */
+ return CMAC_Init(macctx->ctx, NULL, 0, NULL, NULL);
+}
+