From: Wenkai Lin <linwenkai6@hisilicon.com> Common digests (SHA/SM3) need SCENE_STREAM for streaming hash but only CTR/GCM streaming was described in the FS, so hash streaming was misconfigured. GMAC uses SCENE_IPSEC independently. Use SCENE_STREAM for common digests; keep SCENE_IPSEC for GMAC only. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> --- v1/drv/hisi_sec_udrv.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/v1/drv/hisi_sec_udrv.c b/v1/drv/hisi_sec_udrv.c index 7eba121..6ad6c57 100644 --- a/v1/drv/hisi_sec_udrv.c +++ b/v1/drv/hisi_sec_udrv.c @@ -1827,7 +1827,17 @@ static int fill_digest_bd3(struct wd_queue *q, struct hisi_sec_bd3_sqe *sqe, return ret; sqe->type = BD_TYPE3; - sqe->scene = is_storage ? SCENE_STORAGE : SCENE_IPSEC; + + /* + * GMAC is an IPSEC-specific auth algo (RFC4543); other digests use + * stream scene for long-data hash processing. + */ + if (is_storage) + sqe->scene = SCENE_STORAGE; + else if (msg->alg == WCRYPTO_AES_GMAC) + sqe->scene = SCENE_IPSEC; + else + sqe->scene = SCENE_STREAM; sqe->auth = AUTH_MAC_CALCULATE; sqe->a_len = msg->in_bytes; -- 2.50.1.windows.1