lowRISC / qemu

Fork of QEMU for development of lowRISC platforms (including OpenTitan)
http://www.qemu.org
Other
3 stars 8 forks source link

ot_kmac: fix cSHAKE/KMAC prefix handling #19

Closed loiclefort closed 1 year ago

loiclefort commented 1 year ago

Defer prefix processing to the point where cSHAKE init is done to avoid trying to parse prefixes in other modes. If prefix parsing fails, just emit a guest_error trace and continue processing (the resulting digest will obviously be wrong in this case).

KMAC prefix is still checked at START if KMAC_EN is set. This test is now similar to the RTL implementation, by matching the first 6 bytes of the prefix with a known value.