Unverified Commit 167a861f authored by Eric Gouriou's avatar Eric Gouriou Committed by GitHub
Browse files

[Zvk Code Samples] Fix mask logic of GHASH-via-Zvbc (#338)

As discovered by @shakakao and reported by @nibrunieAtSi5
(see https://github.com/riscv/riscv-crypto/issues/331), the
Zvbc-based GHASH logic incorrectly relies on vxor to leave
masked-off lanes undisturbed even though it sets the vector
state with a mask agnostic policy.

The fix is to use ", mu" to request masked-off elements to be
undisturbed.

I did check all proof-of-concept tests in an environment where
masked-off elements get overwritten when "ma" is in effect.
Prior to those fixes only the 'aes-gcm-test' fails, and all
pass with those fixes.

Fixes: https://github.com/riscv/riscv-crypto/issues/331



Signed-off-by: default avatarEric Gouriou <ego@rivosinc.com>
parent e2ba7f61
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment